在PageSpeed Insight API v5的json结果中查找分数 [英] Find score inside json result of PageSpeed Insight api v5
问题描述
我正在尝试了解Google v5 API页面的速度,但是在json结果中找不到SCORE.
I'm trying the Google v5 API page speed insight but i don't find the SCORE inside the json result.
这是api https://www.googleapis.com/pagespeedonline/v5/runPagespeed
在v4中,有一个ruleGroups.SPEED.score,其中包含带有分数的整数.
In the v4 there is a ruleGroups.SPEED.score that contains an integer with the score.
在哪里可以找到v5内的分数?
Where i can find the score inside the v5?
谢谢
推荐答案
我认为它是以下内容: json.lighthouseResult.categories.performance.score
I think it is the following: json.lighthouseResult.categories.performance.score
返回一个最大为1的小数.因此,您必须乘以100才能得到百分比.为我工作.但是,我似乎每次都无法获得相同的价值.波动...
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...
这篇关于在PageSpeed Insight API v5的json结果中查找分数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!