Rate Limiting
The API uses in-memory rate limiting keyed by API key ID to protect service quality.
Tiers
| Tier | Limit | Window |
|---|
| Standard | 100 requests | 1 minute |
| Elevated | 500 requests | 1 minute |
Your rate limit tier is determined by your subscription plan.
Every API response (including 429 errors) includes rate limit headers:
| Header | Description |
|---|
X-RateLimit-Limit | Maximum requests allowed per window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp (seconds) when the window resets |
HTTP/1.1 200 OK
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1711234560
Handling rate limits
When you exceed the limit, the API returns a 429 Too Many Requests response. Use the X-RateLimit-Reset header to determine when to retry.
async function fetchWithRetry(url, options, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
const response = await fetch(url, options);
if (response.status !== 429) return response;
const resetAt = Number(response.headers.get('X-RateLimit-Reset'));
const waitMs = Math.max(0, resetAt * 1000 - Date.now()) + 100;
console.log(`Rate limited. Waiting ${Math.ceil(waitMs / 1000)}s...`);
await new Promise(resolve => setTimeout(resolve, waitMs));
}
throw new Error('Max retries exceeded');
}
To avoid hitting rate limits, add small delays between requests when iterating through paginated results, and cache responses where possible.