> ## Documentation Index
> Fetch the complete documentation index at: https://docs.api.nickautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rate Limiting

> Understand your per-key rate limits and how to handle 429 responses.

# Rate Limiting

Each API key has a rate limit applied to it. This protects the shared LinkedIn session and keeps scraping activity within safe bounds.

## Your rate limit

Every key is assigned a **requests-per-second (RPS)** limit when it is created. The default is:

* **0.2 requests per second** (12 requests per minute)
* Configured per key — contact your provider if you need a higher limit

The limit includes a small **burst allowance**, allowing short spikes above the steady-state RPS before requests are throttled.

## When you exceed the limit

If you send requests faster than your key allows, the API responds with `429 Too Many Requests`:

```json theme={null}
{
  "detail": "Rate limit exceeded"
}
```

The response may also include a `Retry-After` header indicating how many seconds to wait before retrying.

## Handling 429s

Implement exponential backoff with jitter in your client code. Here's a Python example:

```python theme={null}
import time
import random
import requests

def scrape_with_retry(payload, headers, max_retries=5):
    url = "https://api.nickautomations.com/linkedin/scrape"

    for attempt in range(max_retries):
        response = requests.post(url, json=payload, headers=headers)

        if response.status_code == 200:
            return response.json()

        if response.status_code == 429:
            # Honor Retry-After header if present, otherwise back off
            retry_after = response.headers.get("Retry-After")
            if retry_after:
                wait = float(retry_after)
            else:
                wait = (2 ** attempt) + random.uniform(0, 1)
            print(f"Rate limited. Waiting {wait:.1f}s before retry {attempt + 1}/{max_retries}")
            time.sleep(wait)
            continue

        # For other errors, raise immediately
        response.raise_for_status()

    raise Exception(f"Max retries ({max_retries}) exceeded")
```

## Tips for staying within limits

<Note>
  The API also enforces built-in delays between scraping requests to protect the underlying LinkedIn session. Your requests may take longer than expected even if you're under your RPS limit.
</Note>

* **Space out requests** — add a delay of at least 5 seconds between calls to stay safely under the limit
* **Cache results** — avoid re-scraping the same search by storing responses locally
* **Use pagination efficiently** — each `/scrape` call returns 25 items, so you only need one call per page (see [Pagination](/guides/pagination))
* **Monitor your usage** — if you consistently hit 429s, contact your provider about raising your RPS limit

## Next steps

* [Pagination](/guides/pagination) — page through results efficiently
* [Scrape API Reference](/api-reference/scrape) — full endpoint documentation
