Haven’t installed the SDK yet? Follow Installation first.
Basic usage
Send a GET request
Call
client.Get() with a context.Context and the URL you want to scrape:response is a *scraperapi.Response, a thin wrapper that also exposes the original *http.Response.Add request parameters
Pass a
*scraperapi.RequestParameters instead of nil to enable Universal Scraper API features like JavaScript rendering or Premium Proxies:Check the result
Since the SDK doesn’t turn a non-2xx response into a Go See Error Handling and Retries for how to configure automatic retries so you don’t have to handle every transient failure manually.
error, always check the status before using the content:Troubleshooting
response.StatusCode()is401or similar auth error: Double-check your API key was copied correctly from the ZenRows Request Builder with no extra whitespace. SeeAUTH002.response.String()is empty or looks like an error page, not the target site: The target likely needsJSRender: trueand/orUsePremiumProxies: true. SeeREQS002.- Request hangs for a long time: Pass a
context.Contextcreated withcontext.WithTimeout(...). We recommend not going below 3 minutes for protected sites usingJSRender. 429 Too Many Requests: You’ve hit your plan’s concurrency or rate limit. See Concurrency.
Pricing
Cost depends on the parameters you send, not on the SDK itself:| Configuration | Cost multiplier vs. basic |
|---|---|
Basic request (no JSRender/UsePremiumProxies) | 1x |
JSRender: true | 5x |
UsePremiumProxies: true | 10x |
JSRender: true + UsePremiumProxies: true | 25x |
FAQ (Frequently Asked Questions)
Do I need to pass params for every request?
Do I need to pass params for every request?
No, passing
nil is valid, it’s the same as an empty &scraperapi.RequestParameters{}.Why doesn't a failed request return a Go error?
Why doesn't a failed request return a Go error?
By design, the SDK returns a
*Response even for error status codes. Check response.IsSuccess() or response.StatusCode() 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
*scraperapi.Client and call .Get()/.Post()/.Put() on it as many times as needed, there’s no need to recreate it per request. It’s also safe to share across goroutines.What’s next
POST and PUT Requests
Submit forms or data payloads.
Concurrency
Scrape many URLs in parallel.
Custom Headers
Forward specific headers to the target site.