Skip to main content

Rate Limits

The bitbybit Open API enforces rate limits to ensure fair usage and platform stability.

Current Limits

LimitValue
Requests per minute per API key100

Rate Limit Headers

Every API response includes standard rate limit headers:
HeaderDescription
RateLimit-LimitMaximum requests allowed in the current window
RateLimit-RemainingRemaining requests in the current window
RateLimit-ResetSeconds until the rate limit window resets

Handling Rate Limits

When you exceed the rate limit, you’ll receive a 429 response:
{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Too many requests. Please retry after the reset period."
  }
}
Recommended retry strategy:
  1. Check the RateLimit-Reset header for when to retry
  2. Use exponential backoff: wait 1s, then 2s, then 4s, etc.
  3. Add random jitter to avoid thundering herd
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 resetAfter = response.headers.get('RateLimit-Reset') || '60';
      const waitMs = Math.min(parseInt(resetAfter) * 1000, 60000);
      const jitter = Math.random() * 1000;
      await new Promise(resolve => setTimeout(resolve, waitMs + jitter));
      continue;
    }

    return response;
  }
  throw new Error('Max retries exceeded');
}