---
agent:
  instructions: "Search crawlapi docs via GET /.well-known/search?q={query} (add &format=json or Accept: application/json for JSON)."
  endpoint: "https://docs.crawlapi.dev/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://docs.crawlapi.dev/llms.txt"
---

> Documentation index: https://docs.crawlapi.dev/llms.txt
> Search docs: https://docs.crawlapi.dev/.well-known/search?q={query}
> OpenAPI 3.1 specification: https://docs.crawlapi.dev/openapi.json

# Rate limits

> Per-account minute and concurrency limits, `RateLimit` headers, and `429` handling.

Every account has two limits shared across all of its API keys and connected OAuth MCP clients:

- **Requests per minute:** Token bucket refilling continuously over a 60-second window.
- **Concurrent requests:** Maximum number of in-flight scrapes running simultaneously.

New accounts start at **`200` requests/min** and **`10` concurrent requests**. Your limits rise as your purchases add up: once they reach the price of a pack in total, you have its limits. They never go down. See [API keys and billing](https://docs.crawlapi.dev/account.md) for the full pack table.

Account endpoints (`GET /v1/account` and `DELETE /v1/account/key`) have a separate **`60` requests/min** limit and do not count against your scrape concurrency or minute limits. Requests over any limit return `429 RATE_LIMITED` with `Retry-After` immediately.

## RateLimit headers

Authenticated responses include standard `RateLimit-Policy` and `RateLimit` headers:

```text
RateLimit-Policy: "minute";q=200;w=60, "concurrency";q=10;qu="concurrent-requests"
RateLimit: "minute";r=199;t=1, "concurrency";r=9
```

| Header / parameter | Meaning |
| --- | --- |
| `RateLimit-Policy` `"minute";q=N;w=60` | Account allowance of `N` requests per 60-second window |
| `RateLimit-Policy` `"concurrency";q=M` | Account allowance of `M` simultaneous in-flight requests |
| `RateLimit` `"minute";r=R` | Whole requests that can start immediately |
| `RateLimit` `t=S` | Seconds until the next minute token refills (omitted when your per-minute allowance is full) |
| `RateLimit` `"concurrency";r=C` | Free in-flight slots remaining |
| `Retry-After` | Present on `429` (and transient `500`); whole seconds to wait before retrying |

## Parsing `RateLimit` headers

**TypeScript**

```typescript
export function parseRateLimit(header: string | null) {
  if (!header) return null;
  const minuteRemaining = /"minute"[^,]*;r=(\d+)/.exec(header)?.[1];
  const nextTokenSec = /"minute"[^,]*;t=(\d+)/.exec(header)?.[1];
  const concurrencyRemaining = /"concurrency"[^,]*;r=(\d+)/.exec(header)?.[1];
  return {
    minuteRemaining: minuteRemaining ? Number(minuteRemaining) : null,
    nextTokenSec: nextTokenSec ? Number(nextTokenSec) : 0,
    concurrencyRemaining: concurrencyRemaining ? Number(concurrencyRemaining) : null,
  };
}
```

**Python**

```python
import re

def parse_rate_limit(header: str | None) -> dict[str, int | None] | None:
    if not header:
        return None
    minute_r = re.search(r'"minute"[^,]*;r=(\d+)', header)
    minute_t = re.search(r'"minute"[^,]*;t=(\d+)', header)
    conc_r = re.search(r'"concurrency"[^,]*;r=(\d+)', header)
    return {
        "minute_remaining": int(minute_r.group(1)) if minute_r else None,
        "next_token_s": int(minute_t.group(1)) if minute_t else 0,
        "concurrency_remaining": int(conc_r.group(1)) if conc_r else None,
    }
```

## Handling `429 RATE_LIMITED`

`429` ([`RATE_LIMITED`](https://docs.crawlapi.dev/errors.md#RATE_LIMITED)) occurs in three cases:

1. **Concurrency limit reached:** `Retry-After: 1`. Wait for an in-flight request to finish before sending another.
2. **Per-minute limit reached:** `Retry-After` gives exact seconds until a token refills.
3. **Temporary service load:** `Retry-After` gives the backoff wait in seconds.

## Sizing your worker pool

- **Match concurrency to your limit:** Cap your worker pool or semaphore to the `"concurrency";q=M` value in `RateLimit-Policy` so requests queue locally instead of tripping `429`.
- **Add jitter to retries:** When multiple workers receive `429` together, add a small random delay on top of `Retry-After` so they do not collide again.
- **Stop on auth or balance errors:** Fix `401` and `402` immediately rather than retrying in a loop.
