Rate Limits

Understand API rate limits and how to handle them in your application.

Rate Limit Overview

Rate limits are applied per API key to ensure fair usage and system stability.

100

Requests per minute

5,000

Requests per hour

50,000

Requests per day

Rate Limit Headers

Every API response includes headers to help you track your rate limit status:

Header Description
X-RateLimit-Limit Maximum requests allowed per window
X-RateLimit-Remaining Requests remaining in current window
X-RateLimit-Reset Unix timestamp when the limit resets
Retry-After Seconds to wait before retrying (only on 429)

Example Headers

HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1705312800

Handling Rate Limits

When you exceed the rate limit, you will receive a 429 response:

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 30

{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Too many requests. Please wait 30 seconds."
  }
}

Best Practices

  • Implement exponential backoff when retrying failed requests
  • Cache responses when possible to reduce API calls
  • Monitor the X-RateLimit-Remaining header to avoid hitting limits
  • Use webhooks instead of polling when available

Retry Example

async function fetchWithRetry(url, options, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    const response = await fetch(url, options);
    
    if (response.status === 429) {
      const retryAfter = response.headers.get('Retry-After') || 30;
      // Wait before retrying
      await new Promise(r => setTimeout(r, retryAfter * 1000));
      continue;
    }
    
    return response;
  }
  
  throw new Error('Max retries exceeded');
}

Plan Limits

Plan Per Minute Per Hour Per Day
Free 30 500 1,000
Pro 100 5,000 50,000
Enterprise 500 25,000 Unlimited