Haven’t installed the SDK yet? Follow Installation first.
Basic usage
Send a GET request
Call
client.get() with the URL you want to scrape:response is a standard requests.Response object.Add request parameters
Pass a
params dictionary to enable Universal Scraper API features like JavaScript rendering or Premium Proxies:Check the result
Since the SDK doesn’t raise an exception on non-2xx responses, always check the status before using the content: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_codeis401or similar auth error: Double-check your API key was copied correctly from the ZenRows Request Builder with no extra whitespace. SeeAUTH002.response.textis empty or looks like an error page, not the target site: The target likely needsjs_render=Trueand/orpremium_proxy=True. SeeREQS002.- Request hangs for a long time: Pass a
timeoutkeyword argument, e.g.client.get(url, timeout=60). We recommend not going below 3 minutes for protected sites usingjs_render. 429 Too Many Requests: You’ve hit your plan’s concurrency or rate limit. See Async Requests and Concurrency.
Pricing
Cost depends on theparams you send, not on the SDK itself:
| Configuration | Cost multiplier vs. basic |
|---|---|
Basic request (no js_render/premium_proxy) | 1x |
js_render=True | 5x |
premium_proxy=True | 10x |
js_render=True + premium_proxy=True | 25x |
FAQ (Frequently Asked Questions)
Do I need params for every request?
Do I need params for every request?
No,
params is optional. client.get(url) alone works for public pages with no anti-bot protection.Why doesn't a failed request raise an exception?
Why doesn't a failed request raise an exception?
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.Can I reuse the same client for multiple requests?
Can I reuse the same client for multiple requests?
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.