What is concurrency?
Concurrency refers to the number of ongoing requests that happen at any given time. By different means, computers and languages can call the API in parallel and wait for results while others are still running. You can use concurrency with any ZenRows plan; check out pricing for more details.
For more details, check our how-to guide on concurrency to see details about implementation in Python and JavaScript.
Important Behavior to Understand
Canceled Requests Still Count Against Your Concurrency
One crucial thing to understand is that canceling requests on the client side does NOT immediately free up concurrency slots. When you cancel a request:
- Your client stops waiting for a response
- But the ZenRows server continues processing the request
- The concurrency slot remains occupied until the server-side processing completes
- Only then is the concurrency slot released
This can lead to unexpected 429
errors if you’re canceling requests and immediately trying to make new ones, as your concurrency limit might still be reached.
Security System for Failing Requests
ZenRows implements a security system that may temporarily ban your API key if you send too many failing requests in a short period. Types of failing requests that can trigger this include:
429 Too Many Requests
errors due to exceeding concurrency limits- Invalid API key errors
400 Bad Request
errors due to invalid parameters- Other repeated API errors
If your API key gets temporarily banned, you’ll receive an error from the API. If the requests continue, the IP address might get banned for a few minutes and the requests will not even connect with the server.
Monitoring Your Concurrency Usage
You can monitor your concurrency usage through response headers:
These headers provide valuable information about your request:
- Concurrency-Limit: Your maximum concurrent request limit based on your plan
- Concurrency-Remaining: Number of additional concurrent requests you can make
- X-Request-Cost: The cost of this request (varies based on enabled features)
- X-Request-Id: Unique identifier for this request - essential when reporting issues to support
- Zr-Final-Url: The final URL after any redirects that occurred during the request
Related questions
How many concurrent requests are included in my plan?
The concurrency limit varies by subscription plan:
- Trial plan: 5 concurrent requests
- Developer plan: 20 concurrent requests
- Startup plan: 50 concurrent requests
- Business plan: 100 concurrent requests
- Business 500: 150 concurrent requests
- Business 1K: 200 concurrent requests
- Business 2K: 300 concurrent requests
- Business 3K: 400 concurrent requests
Enterprise plans can include custom concurrency limits to fit your needs. Contact us for tailor-made Enterprise solutions.
If get a “429 Too Many Requests” error, do I lose that request or is it queued?
You’ll receive an error, and that request won’t be queued or retried automatically. You’ll need to manage retries on your end, ensuring you don’t exceed your concurrency limit.
Can I increase my concurrency limit?
Absolutely! We offer various plans with different concurrency limits to suit your needs. If you find yourself frequently hitting the concurrency limit, consider upgrading.
How can I monitor my concurrency usage?
When using the Universal Scraper API, each response includes these helpful headers:
Concurrency-Limit
: Shows your maximum concurrent request limitConcurrency-Remaining
: Shows how many free concurrency slots you have available
I’ve been blocked by repeatedly exceeding my concurrency limit. Why?
Whenever you exceed your plan concurrency limit, you’ll start receiving “429 Too Many Requests” errors. If you keep sending more and more requests exceeding your plan concurrency limit in a short period of time, the service may temporarily block your IP address to prevent API misuse.
The IP address ban will last only a few minutes, but repeatedly being blocked might end in a long-lasting block. Check the concurrency optimization section for more information on how to limit concurrent requests to prevent being blocked.
Troubleshooting with Support
When contacting ZenRows support for any issues with your requests, always include:
- The X-Request-Id from the response headers
- The exact error message you received
- The timestamp of when the error occurred
- Details about the parameters you used in the request
This information, especially the Request ID, allows our support team to quickly locate your specific request in our logs and provide more effective assistance.