Device Type

If your use case requires you to exclusively use either Desktop or Mobile User Agents in the headers it sends to the target website, then you can use the device_type parameter to specify whether a Desktop or Mobile client is emulated.

  • Set device_type=desktop to have the API set a desktop (e.g. iOS, Windows, or Linux) User Agent. Note: This is the default behavior. Not setting the parameter will have the same effect.

  • Set device_type=mobile to have the API set a mobile (e.g. iPhone or Android) User Agent.

Note: The device type you set will be overridden if you use keep_headers=true and send your own User Agent in the request headers.

  • API REQUEST

curl --request GET \
  --url 'https://api.scraperapi.com?api_key=API_KEY&device_type=mobile&url=https://example.com/'
  • ASYNC REQUEST

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
        "apiKey": "API_KEY",
        "url": "https://example.com/",
        "apiParams": {
          "device_type": "mobile"
        }
      }' \
  "https://async.scraperapi.com/jobs"
  • PROXY MODE

Last updated