Rate limit

Prev

Working with rate limits

The Bloxs API has rate limits. A rate limit is the maximum number of requests that one API user can send to one Bloxs environment in one minute.

Each API user has a separate limit for each request type. The requests of one API user do not use the limit of a different API user.

If an API user sends more requests than the limit, the API refuses the subsequent requests of that request type until the rate limit window resets.


How many requests can be made per minute?

The number of API requests that an API user can send in one minute depends on the request type. Refer to Table 1.

Table 1: Rate limits per request type

Request type

Limit for each API user

Authorization requests

10 requests / min

Download requests (images of published objects)

100 requests / min

Filter requests (the URL ends with /filter)

100 requests / min

Data update requests (insert, update, delete)

100 requests / min

Other GET requests

500 requests / min

OData feed requests

500 requests / min


What happens if the rate limit is exceeded?

The rate limiter starts when the number of requests of one API user is more than a limit in Table 1.

The API then refuses the requests of that API user for that request type until the end of the current 60 second window. Each refused request gets the HTTP status code 429 Too Many Requests.

When the API knows the remaining time, the response contains the Retry-After header. The value is the number of seconds until the window resets.

Requests of other request types and requests of other API users continue as usual.


How can rate limiting be avoided?

These recommendations help to keep the API usage below the limits.

Use filter requests with paging

Use a filter request to get many records in one request. Do not send one request for each record. Use the paging fields to get the result in pages.

Cache API responses

Save API responses locally when the data does not change frequently. Use the saved data to fill pages. Do not send a new API request for each page load.

Use the Retry-After header

When a request gets the status code 429, wait for the time in the Retry-After header. Then send the request again.