How to check website score on mobile and desktop devices with Google PageSpeed Insights

Authors: CodeToday | Website Components | Views: 276 | Posted: 10 AM: 09/30/2017

Google PageSpeed Insights is a tool to check the compatibility of a website on your mobile device and desktop, so that you know a lot of parameters about a website and how to optimize it, the parameters provided. including: id (the exact address of a domain), ruleGroups (website compatibility and speed), pageStats (html, css, javascript ...) ....

You can also see:  How to take screenshot web page by php through Google PageSpeed Insights API

Today I will guide you how to display website score on mobile and desktop devices, the remaining parameters you can do the same.

Main URL (Ex: url = sitelinks.info):

https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url=http://www.sitelinks.info

Query parameters as follows:

  • Mobile: &strategy=mobile
  • Desktop: &strategy=desktop
To check the compatibility of a website with Google PageSpeed Insights we use the &fields=ruleGroups

Google pagespeed insights mobile

https://www.googleapis.com/pagespeedonline/v2/runPagespeed?fields=ruleGroups&strategy=mobile&url=http://www.sitelinks.info
Result: 

Google pagespeed insights desktop

https://www.googleapis.com/pagespeedonline/v2/runPagespeed?fields=ruleGroups&strategy=desktop&url=http://www.sitelinks.info

Result:


If you have any questions, please leave a message below