Rate limiting
To ensure stability and fair usage, the API enforces rate limits on the number of requests that can be made within a specific time period. This mechanism helps protect the system from excessive traffic and ensures reliable performance for all users.
Current Rate Limit
- Limit: 10 requests per second.
- Scope: Rate limits are applied per API key.
Note:
The rate limit is temporary and may change based on usage patterns and system requirements. Check this page regularly for updates.
How Rate Limiting Works
If a client exceeds the rate limit:
- The server will respond with a
429 Too Many Requestsstatus code. - Further requests will be denied until the rate limit resets.
Example Response (Rate Limit Exceeded)
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
{
"error": "Rate limit exceeded. Please wait and retry after the specified time."
}
Identifying Rate Limits
The API includes rate limit information in the response headers of each request.
Response Headers
| Header | Description |
|---|---|
RateLimit-Limit | The maximum number of requests allowed per minute. |
RateLimit-Remaining | The number of requests remaining in the current window. |
RateLimit-Reset | The time (in seconds) until the rate limit resets. |
Example Headers
RateLimit-Limit: 10
RateLimit-Remaining: 6
RateLimit-Reset: 30
Best Practices for Clients
-
Monitor Rate Limit Headers:
Use the
RateLimit-RemainingandRateLimit-Resetheaders to track your usage and avoid exceeding the limit. -
Implement Retry Logic:
If you receive a
429 Too Many Requestsresponse, implement a delay before retrying based on theRateLimit-Resetvalue.
Example (Exponential Backoff in JavaScript)
async function makeRequest() {
try {
const response = await axios.get('<https://api.example.com/resource>');
console.log(response.data);
} catch (error) {
if (error.response && error.response.status === 429) {
const resetTime = error.response.headers['Ratelimit-Reset'];
console.warn(`Rate limit exceeded. Retrying after ${resetTime} seconds.`);
setTimeout(makeRequest, resetTime * 1000);
} else {
console.error(error);
}
}
}
makeRequest();
-
Optimize Requests:
Batch or cache requests whenever possible to minimize the number of API calls.
-
Contact Support for Higher Limits:
If you anticipate higher usage, reach out to our Support Team to discuss rate limit adjustments.
Updated 10 months ago
