Skip to main content

Response Headers

When you make API requests, these headers show your rate limit status:
HeaderDescription
ratelimit-limitMaximum requests allowed in the current window
ratelimit-remainingRequests remaining in the current window
ratelimit-resetSeconds until the window resets

Example Response Headers

ratelimit-limit: 100;w=60
ratelimit-remaining: 95
ratelimit-reset: 45
This means:
  • 100 requests allowed per 60 seconds
  • 95 requests remaining
  • Window resets in 45 seconds

Handling Rate Limits

When you exceed the rate limit, you receive a 429 Too Many Requests response. Best practices:
1

Check Headers

Check ratelimit-remaining before making requests
2

Wait on 429

When you receive a 429, wait for ratelimit-reset seconds
3

Implement Backoff

Implement exponential backoff for retries

Retry Strategy

async function fetchWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    const response = await fetch(url, options);

    if (response.status === 429) {
      const resetAfter = parseInt(response.headers.get('ratelimit-reset') || '5');
      console.log(`Rate limited. Waiting ${resetAfter} seconds...`);
      await new Promise(resolve => setTimeout(resolve, resetAfter * 1000));
      continue;
    }

    return response;
  }
  throw new Error('Max retries exceeded');
}
Rate limit headers appear only when the underlying API provides rate limit information. Some integrations may not include these headers.