rate_limit_exceeded
You sent too many requests.
Limits apply to your organization, for all of its keys together. More keys do not give more capacity.
Test mode has the same limits, with separate counters.
Why it happens
| Policy | Limit | Endpoints |
|---|---|---|
sustained | 20 req/s | All |
geocoding | 10 req/s | POST /v1/orders, POST /v1/orders/quote, POST /v1/addresses/validate |
order-list | 2 req/s | GET /v1/orders |
Univooz measures over a 10-second period. So sustained permits 200 requests in 10
seconds. Short groups of requests are acceptable. A continuous loop is not.
The narrow policies are additional to sustained. A GET /v1/orders uses both.
The message gives the policy.
How to fix it
Wait for the number of seconds in Retry-After. Then send fewer requests.
Better: read the headers on every response and slow down before the error:
RateLimit-Policy: "sustained";q=200;w=10, "order-list";q=20;w=10
RateLimit: "sustained";r=196;t=7, "order-list";r=18;t=7r is your remaining number of requests. t is the seconds until it resets.
Read GET /v1/orders one time every 30 seconds. A plan of 5,000 orders each month is
approximately seven orders each hour. One request each second gives approximately 500
requests for each order.
For faster information, use webhooks.
Example response
{
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded for policy 'order-list'.",
"doc_url": "https://docs.univooz.com/errors/rate_limit_exceeded",
"request_id": "req_01KZCCF8ZH4M7XQ2VB9RSTNPKD"
}
}