# Rate limits and concurrency for the Spider API | Spider

Understand Spider API rate limits, HTTP headers, and best practices for handling 429 errors.

Canonical: https://spider.cloud/docs/core/rate-limits/

## API rate limits

Pay as you go starts at 10,000 requests per minute and rises through four levels to 80,000 as the account uses more. Enterprise raises it further. Unlimited is limited by concurrency instead. AI Studio has its own per-second limit.

## Core API limits by plan

Counted per account in a fixed one-minute window. Applies to /crawl, /scrape, /links, /search and the other core endpoints.

| Plan          | Limit                                | Notes                                                                                                                                                                                                                                                  |
| ------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Pay as you go | 10,000 to 80,000 requests per minute | Pay as you go starts at 10,000 requests per minute and rises through four levels to 80,000 as the account uses more.                                                                                                                                   |
| Unlimited     | Your concurrency count               | Requests at once, the number you buy. A request counts as 1 in http mode and 2 in browser mode. Smart mode, the default, counts as 1, and as 2 once a page needs a browser. A per minute cap of at least 10,000 sits underneath and is rarely reached. |
| Enterprise    | 50,000 requests per minute           | Higher caps on request, set per account.                                                                                                                                                                                                               |

## Rate limit levels

Your account moves up a level as you use Spider more, and each level raises your per minute limit. Your level and your progress to the next one are on your [settings page](https://spider.cloud/account/settings/), and every response carries it in `RateLimit-Limit`.

| Level   | Requests per minute |
| ------- | ------------------- |
| Level 1 | 10,000              |
| Level 2 | 20,000              |
| Level 3 | 40,000              |
| Level 4 | 80,000              |

## Unlimited

An [Unlimited](https://spider.cloud/docs/api/unlimited/) plan is limited by concurrency, not by requests per minute. Your concurrency count is how many requests can run at once on `/unlimited/scrape`, `/unlimited/crawl` or `/unlimited/links`. Buy 25 and 25 requests can run at the same time. A request counts as 1 in http mode and 2 in browser mode. Smart mode, the default, counts as 1, and as 2 once a page needs a browser. When the plan is full, a new request gets a 429 at once and adds nothing to the bill. The `429` carries a `Retry-After` header, and nothing queues. Each response carries `X-Concurrency-Limit` and `X-Concurrency-Active` so you can watch usage. The per minute cap underneath works the same way as on every other plan. Size your plan by concurrency, not by the minute.

## AI Studio

[AI Studio](https://spider.cloud/ai/pricing/) endpoints use a per-second limit set by your subscription tier. Past it, the API returns `429` with `Retry-After` rounded up to the next second. AI requests still spend credits on your account.

| Tier       | Requests per second |
| ---------- | ------------------- |
| Starter    | 1                   |
| Lite       | 5                   |
| Standard   | 10                  |
| Scale      | 25                  |
| Enterprise | Custom, beyond 25   |

## Rate limit headers

Every core API response carries these headers. Read them to slow down before you hit the limit.

| Header              | Description                                                                |
| ------------------- | -------------------------------------------------------------------------- |
| RateLimit-Limit     | Requests allowed per minute on your account.                               |
| RateLimit-Remaining | Requests left in the current window.                                       |
| RateLimit-Reset     | Seconds until the window resets.                                           |
| Retry-After         | Seconds to wait before retrying. Only on a 429 Too Many Requests response. |

## 5-hour usage limit

Each account also has a 5-hour usage limit on requests, pages and bandwidth. It is set well above normal use and rises with the rate limit level. The window opens with your first request and resets 5 hours later. Unlimited plans have one too, sized by concurrency. Your [settings page](https://spider.cloud/account/settings/) shows how much of the window you have used and when it resets. At the limit the API returns `429` with `"window": "5h"` in the body, and `Retry-After` holds the seconds until the reset.

## Handle a 429

Past the limit, the API returns `429 Too Many Requests` with a `Retry-After` header. Wait the number of seconds in Retry-After, then send the request again. Fall back to exponential backoff only when the header is missing.

Python backoff

```
import requests
import time
import os

def request_with_backoff(url, headers, json_data, max_retries=5):
    """Make an API request with exponential backoff on rate limits."""
    for attempt in range(max_retries):
        response = requests.post(url, headers=headers, json=json_data)

        if response.status_code == 429:
            # Use Retry-After header, or fall back to exponential backoff
            retry_after = response.headers.get('Retry-After')
            wait_time = int(retry_after) if retry_after else 2 ** attempt
            print(f"Rate limited. Retrying in {wait_time}s...")
            time.sleep(wait_time)
            continue

        # Check remaining quota to proactively slow down
        remaining = response.headers.get('RateLimit-Remaining')
        if remaining and int(remaining) < 10:
            reset = int(response.headers.get('RateLimit-Reset', 1))
            time.sleep(reset)

        return response

    raise Exception("Max retries exceeded")

headers = {
    'Authorization': f'Bearer {os.getenv("SPIDER_API_KEY")}',
    'Content-Type': 'application/json',
}

result = request_with_backoff(
    'https://api.spider.cloud/crawl',
    headers,
    {"url": "https://example.com", "limit": 5}
)
print(result.json())
```

Node.js backoff

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

    if (response.status === 429) {
      const retryAfter = response.headers.get('Retry-After');
      const waitTime = retryAfter ? Number(retryAfter) : Math.pow(2, attempt);
      console.log(`Rate limited. Retrying in ${waitTime}s...`);
      await new Promise((r) => setTimeout(r, waitTime * 1000));
      continue;
    }

    // Check remaining quota to proactively slow down
    const remaining = response.headers.get('RateLimit-Remaining');
    if (remaining && Number(remaining) < 10) {
      const reset = Number(response.headers.get('RateLimit-Reset') || 1);
      await new Promise((r) => setTimeout(r, reset * 1000));
    }

    return response;
  }

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

const result = await requestWithBackoff('https://api.spider.cloud/crawl', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.SPIDER_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ url: 'https://example.com', limit: 5 }),
});
console.log(await result.json());
```

Tip

Use [streaming](https://spider.cloud/docs/core/concurrent-streaming/) for a large crawl instead of many single requests. One connection carries the whole crawl, so per-request rate limits do not apply.

Tip

On [Unlimited](https://spider.cloud/docs/api/unlimited/) a 429 means all of your concurrency is in use. Wait out `Retry-After`or raise your concurrency count. On AI Studio a 429 clears at the next second.

## Without a key

Keyless access is /scrape only. It is rate limited. On a 429, honor Retry-After. Get a key for anything sustained. Create one at [https://spider.cloud/api-keys](https://spider.cloud/api-keys/).

## Stay under the limit

Five habits worth building in before your volume grows.

- Batch requests. Use `limit` to crawl many pages in one request instead of one request per page.
- Watch the headers. Check `RateLimit-Remaining` before the next request and pause when it nears zero.
- Use webhooks. For a long crawl, receive results by webhook instead of polling.
- Cache results. Store crawl output locally so you never fetch the same page twice.
- Stream. For many pages, use [concurrent streaming](https://spider.cloud/docs/core/concurrent-streaming/) and process results as they arrive.
