I\'m a beginner in PHP, so maybe someone could help to fix this ? My web application is showing Google PageInsights API error..
Here\'s the code, I tried to change vers
The code shared by Siren Brown is absolutely correct, except that while getting the scores we need to send the query parameter &strategy=mobile or &strategy=desktop to get the respective results from Page speed API
$url_mobile = 'https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url='.$url.'&screenshot=true&key='.$myKEY.'&strategy=mobile';
$url_desktop = 'https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url='.$url.'&screenshot=true&key='.$myKEY.'&strategy=desktop';