Skip to main content

Rate limits

Each tenant has two rate limits: one for reads (query) and one for writes (ingest). A bulk import therefore never uses up the capacity your storefront needs for price queries.

How a limit works​

Each limit is a token bucket defined by two numbers:

  • Rate: how fast the bucket refills, in items per second.
  • Burst: how many items the bucket holds, and therefore how many you can send at once.

When the bucket is full, you can send a burst immediately. After that, you can keep sending at the rate. An idle bucket refills up to the burst, and no further. The limit applies to your tenant as a whole, whichever server handles the request.

What a request costs​

Limits count items, not HTTP requests, so batching does not bypass them:

RequestDimensionCost
POST /price/queryqueryThe number of SKUs in skus
POST /price/batch, DELETE /price/batch, POST /article/batch, POST /pricelist/batchingestThe number of items in the array
POST /fx/dailyingestThe number of rates
POST /price/historical-best, POST /pricelist/query, POST /pricelist/search, POST /article/searchquery1
Any other GETquery1
Any other writeingest1

The number of pricelists in a price query does not affect its cost.

Headers​

Every response subject to a limit includes these headers:

HeaderMeaning
X-RateLimit-LimitThe burst: the number of items a full bucket holds
X-RateLimit-RemainingThe approximate number of items left in the bucket
X-RateLimit-ResetWhen the bucket will be full again, in Unix seconds

Exceeding the limit: 429​

429 Too Many Requests means the bucket does not hold enough items for this request at the moment. The Retry-After header gives the number of seconds until it does: wait that long, then retry.

json
{
"status": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded for QUERY",
"retry_after": 2
}

When a request is too large: 413​

A request that costs more than the maximum number of items per request, or more than the burst, can never fit in the bucket. It is rejected with 413 Payload Too Large before any items are deducted. Retrying does not help; split the request instead.

json
{
"status": 413,
"error": "Payload Too Large",
"message": "This request costs 3000 items; at most 2500 are allowed per request. Split it into smaller requests.",
"max_items_per_request": 2500
}

Staying within the limit​

  • Send requests at the rate, and keep the burst for peaks.
  • On a 429 response, wait for the Retry-After period before you send the next request. Retrying in a tight loop only spends capacity on rejected requests.
  • Size your batches according to max_items_per_request, not by trial and error.