使用 PageSpeed Insights API v5 在终端中使用 curl 查找服务器响应时间
例如,如果我在终端中输入这个
curl \'https://pagespeedonline.googleapis.com/pagespeedonline/v5/runPagespeed?url=https://google.com/
&category=performance&strategy=mobile&fields=lighthouseResult.categories.*.score&prettyPrint=false
&key=<MY-KEY>'
将返回
{"lighthouseResult":{"categories":{"performance":{"score":0.68}}}}%
而不是分数,我希望它只返回类似于以下形式的服务器响应时间:
{"lighthouseResult":{"categories":{"performance":{"responseTime":0.68}}}}%
我尝试了以下方法:
fields=lighthouseResult.categories.*.server-response-time
fields=lighthouseResult.categories.*.server-response-time.responseTime
fields=lighthouseResult.categories.audits.server-response-time
fields=lighthouseResult.categories.audits.server-response-time.responseTime
&only-audits=server-response-time