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

# Rate limits

> How many requests an API key can make, and how to stay under it.

Each API key has its own hourly request limit, set when you create the key: 1,000 requests an hour unless you choose
another, up to 100,000. Past it, the API answers 429.

| Who | Limit | Counted per |
| - | - | - |
| A request with an API key | The key's `rate_limit`: 1,000 requests an hour by default, from 1 to 100,000. | Key |
| A request without a key (the price list) | 100 requests an hour | IP address |

The hour is a sliding window. For a key it is kept by the minute: a request counts until the minute it was made in is
an hour old, so for 60 to 61 minutes. Without a key, a request counts for 3,600 seconds. Every request the key is allowed
to make counts, whatever the endpoint and whatever its answer; one refused for a missing scope does not. A key's
`rate_limit` is in `GET /api/v1/api-keys/`, and a key with the `admin` scope can change it with
`PATCH /api/v1/api-keys/{id}/`. A value outside 1 to 100,000 is refused with `400`, naming `rate_limit`.

## Headers

Every answer to a request with a key carries the state of its limit:

| Header | Holds |
| - | - |
| `X-RateLimit-Limit` | The key's limit per hour. |
| `X-RateLimit-Remaining` | Requests left in the current window. |
| `X-RateLimit-Reset` | Seconds until the oldest request in the window stops counting. |

```bash theme={null}
curl -s -o /dev/null -D - "https://go-fetch.io/api/v1/jobs/?limit=1" \
  -H "X-API-Key: $GOFETCH_API_KEY" | grep -i '^x-ratelimit'
```

## When you hit it

The API answers `429 Too Many Requests` with a `Retry-After` header, in seconds:

```json theme={null}
{"detail":"Request was throttled. Expected available in 3652 seconds."}
```

Wait `Retry-After` seconds, then retry. The Python SDK waits and retries by itself, up to 3 times. See
[Errors](https://docs.go-fetch.io/errors.md#429-too-many-requests) for a retry loop.

## Stay under it

* **Use webhooks instead of polling.** One [webhook](https://docs.go-fetch.io/webhooks.md) per job replaces every status check.
* **Poll gently.** If you poll, every 5 to 30 seconds is enough. The SDK starts at 2 seconds and backs off to 30.
* **Page with the largest page.** Read results with `limit=100`.
* **Batch your input.** One job with 50 profiles is one create request and one set of polls; 50 jobs are 50.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.