0

Hi i just want to ask if there's seperated API in pagespeed insight in performance score? Because i only seeing this path to consume in performance score and i don't know if it's for desktop or mobile

lighthouseResult.categories.performance.score
Noel Dulin
  • 321
  • 1
  • 3
  • 12

1 Answers1

1

To determine the strategy from result, we can refer to lighthouseResult.emulatedFormFactor

By default it runs for DESKTOP. To make it run for MOBILE, there exists a query param strategy

Here's sample request for strategy=MOBILE

curl \
  'https://pagespeedonline.googleapis.com/pagespeedonline/v5/runPagespeed?url=https%3A%2F%2Fexample.com&strategy=MOBILE&key=[YOUR_API_KEY]' \
  --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
  --header 'Accept: application/json' \
  --compressed

Reference: here

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83