Device Type

If your use case requires you to exclusively use either desktop or mobile user agents in the headers it sends to the website then you can use the device_type parameter.

  • 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 requests header.


require 'net/http'
require 'json'
params = {
:api_key => "APIKEY",
:url => "",
:device_type => “mobile”
uri = URI('')
uri.query = URI.encode_www_form(params)
website_content = Net::HTTP.get(uri)

require 'httparty'
HTTParty::Basement.default_options.update(verify: false)
response = HTTParty.get('', {
  http_proxyaddr: "",
  http_proxyport: "8001",
  http_proxyuser: "scraperapi.device_type=mobile",
  http_proxypass: "APIKEY"
results = response.body
puts results
  • SDK Method

# remember to install the library: gem install scraperapi
require "scraper_api"
client ="APIKEY")
result = client.get("", device_type: “mobile”).raw_body
puts result

Last updated