Custom Headers come in handy when you need to add your own headers (user agents, cookies, referrer, etc.) to the request.

You can enable Custom Headers by adding &custom_headers=true to the request. The Python and Node SDKs will set this parameter automatically if headers are sent.

# pip install zenrows
from zenrows import ZenRowsClient

client = ZenRowsClient("YOUR_ZENROWS_API_KEY")
url = "https://httpbin.io/anything"
headers = {
	"Referer": "https://www.google.com",
}

response = client.get(url, headers=headers)

print(response.text)

Device

If you require to use either desktop or mobile user agents in the headers, you can use &device=desktop or &device=mobile parameter in the request.

# pip install zenrows
from zenrows import ZenRowsClient

client = ZenRowsClient("YOUR_ZENROWS_API_KEY")
url = "https://httpbin.io/anything"
params = {
    "device": "desktop"
}

response = client.get(url, params=params)

print(response.text)