API reference

Rate limits

When you pass a limit, wait the seconds in Retry-After and send the request again.

fetch-with-retry.ts
export async function fetchWithRetry(url: string, init: RequestInit, maxRetries = 3) {
  for (let attempt = 0; ; attempt++) {
    const res = await fetch(url, init);
    if (res.status !== 429 || attempt === maxRetries) return res;
    const seconds = Number(res.headers.get("Retry-After") ?? 1);
    const jitter = Math.random() * 250;
    await new Promise((resolve) => setTimeout(resolve, seconds * 1000 + jitter));
  }
}

Check the limits

EndpointLimitPer
POST /v1/query120 a minute (60 without a key)API key, signed-in user or IP
POST /v1/query/compile300 a minute (60 without a key)API key, signed-in user or IP
POST /sql/query60 a minute, one query at a time per organizationAPI key
POST /track on basket.databuddy.cc600 a minuteAPI key, or website and IP
Source map uploads2,000 an hourAPI key
Any request with a key20 at onceAPI key
Any request with a key that has its own limit300 a minute, unless the key sets anotherAPI key
MCP tools5 to 60 a minute, by toolConnection

Limits are the same on every plan. Batch parameters into one /v1/query request, and cache past days, to stay under them.

Read a 429

HTTP/1.1 429 Too Many Requests
Retry-After: 8
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1735732810000
{
  "success": false,
  "error": "Rate limit exceeded",
  "code": "RATE_LIMITED",
  "requestId": "req_abc123def456",
  "limit": 120,
  "remaining": 0,
  "reset": 1735732810000,
  "retryAfter": 8
}
FieldUnit
Retry-After, retryAfterSeconds
X-RateLimit-Reset, resetUnix time in milliseconds

Only the 429 response is sure to carry these headers. If keys can't be checked for a moment, you get 503 with SERVICE_UNAVAILABLE and Retry-After: 5.

How is this guide?