Rate limits
The REST API accepts up to 5 requests per second per API key. This page explains how the limit works and how to build your integration so it stays under it.
How the limit works
- 5 requests per second per API key. The limit counts per
client_id. Every access token requested with thatclient_idshares the same 5 requests per second, so requesting extra tokens does not add capacity. - One budget for everything that uses the same credentials. Every server, worker and scheduled job that authenticates with the same
client_iddraws from the same 5 requests per second.
Rate limit headers
Every REST response includes three headers that show where you are within the limit:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Requests allowed per second (5) |
X-RateLimit-Remaining | Requests left in the current second |
X-RateLimit-Reset | Seconds until the counter resets |
When a request goes over the limit
A request over the limit is refused with 429 Too Many Requests:
curl -i https://api.helice.cloud/v2/products/sku/QSFP-40G-SR4 \
-H "Authorization: Bearer ACCESS_TOKEN"
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 5
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1
{"error_msg":"Too many requests"}
The response has no Retry-After header. Use X-RateLimit-Reset to decide how long to wait.
A refused request has not been processed. Propeller rejects it before doing anything with it, so it is safe to send the same request again, including POST, PUT and DELETE requests.
Stay under the limit
- Pace your requests on your side. Send at most 5 requests per second per
client_id, for example with a queue or a token bucket. Limiting how many requests run at the same time is not enough: 5 parallel requests that each take 100 ms add up to 50 requests per second. - Share the budget between processes. If several servers or jobs use the same
client_id, send their calls through one queue, or give each a fixed share of the 5 requests per second. - Reuse your access token until it expires. The
expires_invalue in the token response tells you how long that is, currently 30 minutes. Don't request a new token for every call. See Authentication and Security. - Do more per request. Use bulk endpoints instead of one call per record. Use search endpoints with larger page sizes. See Batch sizing and Pagination. Cache data that rarely changes, such as product and category data.
- Spread scheduled work. Imports and synchronizations that start at the same moment share the same 5 requests per second.
Retry after a 429
- Wait at least
X-RateLimit-Resetseconds, or 1 second if the header is0or missing. Then send the same request again. - If it is refused again, wait longer each time: 1 second, 2 seconds, 4 seconds and so on, with a small random delay added. Stop after a few attempts.
- Log every 429. Regular 429 responses mean your integration sends requests faster than 5 per second.
See also
- Sync Strategies for full and delta syncs and batch sizes
- Authentication and Security for token renewal and error handling
- REST API Reference for the full endpoint specifications