2

I tried API based on the document https://developers.google.com/speed/docs/insights/v5/get-started?hl=en

It gives "emulatedFormFactor": "desktop"

Is there anyway to change it to mobile?

I'm expecting something like below in web-app

https://developers.google.com/speed/pagespeed/insights/?hl=JA&url=https%3A%2F%2Fdevelopers.google.com&tab=mobile

There, we can change device by querying tab=mobile or tab=desktop

atusy
  • 646
  • 3
  • 5

1 Answers1

1

You are looking for strategy and this accepts either "desktop" or "mobile".

So in the example you gave it would be:-

https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=https://developers.google.com&strategy=mobile

It appears you also wanted it to be in Japanese if I understand correctly?

To use different languages / local formatting you would append locale.

So add &locale=ja for Japanese I believe. This is the equivalent of hl=JA in the URL you posted.

GrahamTheDev
  • 22,724
  • 2
  • 32
  • 64