Skip to main content
This guide makes a single GET request with the ZenRows Python SDK: create a client, send the request, read the response.
Haven’t installed the SDK yet? Follow Installation first.

Basic usage

1

Create a client

Import ZenRowsClient and instantiate it with your API key:
from zenrows import ZenRowsClient

client = ZenRowsClient("YOUR_ZENROWS_API_KEY")
2

Send a GET request

Call client.get() with the URL you want to scrape:
from zenrows import ZenRowsClient

client = ZenRowsClient("YOUR_ZENROWS_API_KEY")
url = "https://www.scrapingcourse.com/ecommerce/"

response = client.get(url)

print(response.text)
response is a standard requests.Response object.
See The Response Object for everything available on it.
3

Add request parameters

Pass a params dictionary to enable Universal Scraper API features like JavaScript rendering or Premium Proxies:
from zenrows import ZenRowsClient

client = ZenRowsClient("YOUR_ZENROWS_API_KEY")
url = "https://www.scrapingcourse.com/ecommerce/"

response = client.get(url, params={
    "js_render": True,
    "premium_proxy": True,
    "proxy_country": "us",
})

print(response.text)
params accepts every parameter documented in the Universal Scraper API setup guide, including autoparse, css_extractor, wait_for, block_resources, and outputs. They all work exactly the same way through the SDK.
4

Check the result

Since the SDK doesn’t raise an exception on non-2xx responses, always check the status before using the content:
if response.ok:
    print(response.text)
else:
    print(f"Request failed with status {response.status_code}: {response.text}")
See Error Handling and Retries for how to configure automatic retries so you don’t have to handle every transient failure manually.

Troubleshooting

  • response.status_code is 401 or similar auth error: Double-check your API key was copied correctly from the ZenRows Request Builder with no extra whitespace. See AUTH002.
  • response.text is empty or looks like an error page, not the target site: The target likely needs js_render=True and/or premium_proxy=True. See REQS002.
  • Request hangs for a long time: Pass a timeout keyword argument, e.g. client.get(url, timeout=60). We recommend not going below 3 minutes for protected sites using js_render.
  • 429 Too Many Requests: You’ve hit your plan’s concurrency or rate limit. See Async Requests and Concurrency.

Pricing

Cost depends on the params you send, not on the SDK itself:
ConfigurationCost multiplier vs. basic
Basic request (no js_render/premium_proxy)1x
js_render=True5x
premium_proxy=True10x
js_render=True + premium_proxy=True25x
Only successful requests are billed. See ZenRows Pricing for exact per-plan rates.

FAQ (Frequently Asked Questions)

No, params is optional. client.get(url) alone works for public pages with no anti-bot protection.
By design, the SDK returns the requests.Response object even for error status codes. Check response.ok or call response.raise_for_status() yourself. See Error Handling and Retries.
Yes. Create one ZenRowsClient instance and call .get()/.post()/.put() on it as many times as needed; there’s no need to recreate it per request.

What’s next

POST and PUT Requests

Submit forms or data payloads.

Async Requests and Concurrency

Scrape many URLs in parallel.

Custom Headers

Forward specific headers to the target site.