Working with Rate Limits
The Bloxs API enforces shared rate limits. This means there is a maximum number of requests that all API users within a Bloxs environment can make per minute.
If this limit is exceeded, additional requests will be denied until the rate-limit window resets.
This guide explains how rate limiting works in the Bloxs API.
How many requests can be made per minute?
The number of API requests that can be made per minute depends on the request type. See Table 1 for details.
Table 1: Rate limits per request type
Request type | Limit |
|---|---|
Authorization requests | 10 requests / min |
Download requests | 10 requests / min |
Filter requests | 100 requests / min |
Data update requests (insert, update, delete) | 100 requests / min |
Other GET requests | 500 requests / min |
What happens if the rate limit is exceeded?
The rate limiter is triggered when the total number of API requests exceeds the limits shown in Table 1.
When this happens, the API temporarily stops processing requests for the affected Bloxs environment for the remainder of the current 60-second rate-limit window. During this period, any request results in the HTTP status code 429 Too Many Requests.
How can rate limiting be avoided?
Below are some recommendations to help keep API usage within the allowed limits.
Use field filtering
Field filtering allows requesting only specific fields from a JSON response instead of retrieving the entire representation. This reduces the size and number of requests required.
Cache API responses
To reduce the number of API calls, especially in high-traffic scenarios, consider caching API responses locally. Instead of making a new API request for every page load, retrieve the data once and store it in a cache. The application can then populate pages using the cached data instead of repeatedly requesting the same JSON response.