Rate limiting
The REST Admin API enforces rate limits on requests from each app to each store, allowing a maximum of 4 requests per second.
| API type | Algorithm | Rules |
|---|---|---|
| REST Admin API | Leaky bucket | 4 QPS per app per store, with a maximum burst capacity of 40. |
Algorithm and rules
The REST Admin API is rate-limited. You must manage your app’s request rate for each store. Rate limits are calculated independently based on the unique combination of the app and the store:
- Per-app isolation: Requests from one app do not affect the rate limits of other apps, even if they access the same store.
- Per-store isolation: Requests to one store do not affect the rate limits of other stores, even if they originate from the same app.
The REST Admin API uses the leaky bucket algorithm with the following rules:
- Constant rate: The bucket processes requests at a fixed rate of 4 requests per second (4 QPS).
- Burst processing: The maximum bucket capacity is 40. If the bucket has remaining capacity, new requests are added to the queue and processed sequentially at a rate of 4 QPS.
- Request rejection: When the bucket is full (the number of queued requests reaches 40) and the incoming request rate exceeds the leak rate, subsequent requests are immediately rejected.
To avoid request rejection, keep your app's average request rate within 4 requests per second.
Error responses for rate limiting
When the bucket is full and the incoming rate exceeds the limit, subsequent requests will be rejected and return the following error response:
- HTTP status code:
429 Too Many Requests - Response example:
HTTP/1.1 429 Too Many Requests
{"errors":"Too many request"}
Requests can be processed successfully again once the bucket releases enough capacity. For detailed error code definitions and handling recommendations, refer to HTTP status code.