Rate Limits

Learn about API Hub rate limits and how to work with them to ensure reliable API performance.

Understanding Rate Limits

Rate limits are restrictions on the number of API calls you can make within a specific time period. These limits help ensure fair usage and maintain the quality of service for all users.

General Platform Rate Limit

In addition to API-specific rate limits, API Hub enforces a global rate limit across all APIs:

Platform-wide limit: 1000 requests per minute

This limit applies to the sum of all API calls across all APIs from a single API key.

API-Specific Rate Limits

Each API has its own rate limits.
To see the rate limits for a specific API, please refer to the API's documentation page.

Important Note

For the most up-to-date and detailed rate limit information for a specific API, please refer to that API's documentation page.

Rate Limit Headers

All API responses include headers to help you track your rate limit usage:

1
X-RateLimit-Limit

The maximum number of requests allowed in the current time window

2
X-RateLimit-Remaining

The number of requests remaining in the current time window

3
X-RateLimit-Reset

The time at which the current rate limit window resets (Unix timestamp)

// Example rate limit headers
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1620000000

Handling Rate Limit Errors

When you exceed a rate limit, the API will respond with a 429 Too Many Requests status code and include a Retry-After header indicating how many seconds to wait before making another request.

Best Practices for Handling Rate Limits

Monitor Rate Limits

Keep track of the rate limit headers in API responses to avoid hitting limits.

Implement Exponential Backoff

When you receive a 429 error, use the Retry-After header to wait before retrying.

Cache Responses

Cache API responses when possible to reduce the number of API calls.

Batch Requests

Combine multiple operations into a single API call when the API supports batch operations.

Sample Code for Rate Limit Handling

async function fetchWithRateLimitHandling(url, options) {
let retryCount = 0;
const MAX_RETRIES = 3;
while (retryCount < MAX_RETRIES) {
try {
const response = await fetch(url, options);
// Check remaining rate limit
const remaining = parseInt(response.headers.get('X-RateLimit-Remaining') || '1', 10);
const reset = parseInt(response.headers.get('X-RateLimit-Reset') || '0', 10);
// Log rate limit status for monitoring
console.log(`Rate limit: ${remaining} requests remaining, resets at ${new Date(reset * 1000).toLocaleTimeString()}`);
if (response.status === 429) {
// Rate limit exceeded
const retryAfter = parseInt(response.headers.get('Retry-After') || '60', 10);
console.log(`Rate limit exceeded. Retrying in ${retryAfter} seconds...`);
// Wait for the specified time
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
retryCount++;
continue;
}
return response;
} catch (error) {
console.error('API request failed:', error);
throw error;
}
}
throw new Error('Max retries exceeded due to rate limiting');
}

Increasing Your Rate Limits

If you need higher rate limits than what your current plan offers, you have several options:

  • Upgrade to a higher tier plan through your dashboard
  • Implement caching strategies to reduce API calls
  • Contact sales for custom enterprise plans with higher rate limits

Need Higher Limits?

If your application requires higher rate limits, please contact our sales team to discuss custom enterprise plans.