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 fetch Response object.Add request parameters
Pass a config object as the second argument to enable Universal Scraper API features like JavaScript rendering or Premium Proxies:
Check the result
Since the SDK doesn’t throw 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.statusis401or similar auth error: Double-check your API key was copied correctly from the ZenRows Request Builder with no extra whitespace. SeeAUTH002.- The response body is empty or looks like an error page, not the target site: The target likely needs
js_render: trueand/orpremium_proxy: true. SeeREQS002. await response.text()hangs or the script never finishes: Make sure the call is wrapped in anasyncfunction and awaited; the SDK doesn’t have atimeoutoption, so a hung request will wait indefinitely unless your own code aborts it (e.g. withAbortController).429 Too Many Requests: You’ve hit your plan’s concurrency or rate limit. See Concurrency.
Pricing
Cost depends on the config 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 a config object for every request?
Do I need a config object for every request?
No, the config argument is optional.
client.get(url) alone works for public pages with no anti-bot protection.Why doesn't a failed request throw an exception?
Why doesn't a failed request throw an exception?
By design, the SDK resolves with the
Response object even for error status codes, matching how native fetch behaves. Check response.ok or response.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
ZenRows instance and call .get()/.post() on it as many times as needed, there’s no need to recreate it per request.What’s next
POST Requests
Submit forms or data payloads.
Concurrency
Scrape many URLs in parallel.
Custom Headers
Forward specific headers to the target site.