pagespeedgoogle-pagespeed-insights-api

Find score inside json result of PageSpeed Insights API v5


I'm trying the Google v5 API page speed insight but i don't find the SCORE inside the JSON result.

This is the api https://www.googleapis.com/pagespeedonline/v5/runPagespeed

In the v4 there is a ruleGroups.SPEED.score that contains an integer with the score.

Where i can find the score inside the v5?


Solution

  • I think it is the following: json.lighthouseResult.categories.performance.score

    Returns a decimal with 1 as maximum. So you have to multiply with 100 to get the percentage. Works for me.. However I don't seem to get the same value every time. It fluctuates...