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

# Rate limits

> How requests are counted with and without an API key

Rate limits apply to every version, before an operation runs. A `429` means the operation did not
run.

## With a key: per organization

Calls made with a key share one sliding window per **developer organization**. Every key in every
project of the organization counts together. Limits are not per key, per project or per operation.

| Tier | Requests per minute |
| - | - |
| 50/min | 50 |
| 200/min | 200 |
| 1,000/min | 1,000 |
| Unlimited | Not counted |

Access is free and every tier has the same features. A new organization starts at 50 a minute. See
your allowance under **Rate limits** in the [Developer portal](https://developer.donate.gg/login).
For a different limit, email [support@donate.gg](mailto:support@donate.gg). There is no checkout
or subscription.

## Without a key: per IP address

A public read without a key is limited to **20 requests a minute** per IP address. That is enough
to try the API, not to run an integration. Send your key from your server for anything real.

## Operations with their own budget

Some operations spend a second budget on top of the ones above.

| Operation | Budget |
| - | - |
| `GET /v2/registers/{registerId}/entries` | 120 a minute per project with a key, 30 a minute per IP address without |
| `POST /v2/charity-requests` | 60 an hour per project |
| `POST /v2/campaigns/{campaignId}/deposit-addresses` | 10 a minute for one campaign and 100 an hour in all, per IP address |

See [Request a charity](https://docs.donate.gg/guides/request-a-charity.md#rate-limits) and
[Work with campaigns](https://docs.donate.gg/guides/campaigns.md#give-a-campaign-a-deposit-address).

## Response headers

A response from a limited bucket says where you stand:

| Header | Meaning |
| - | - |
| `X-RateLimit-Limit` | Requests allowed in the window |
| `X-RateLimit-Remaining` | Requests left in the window |
| `X-RateLimit-Reset` | When the window resets, in Unix seconds |

They are sent on successful responses, on errors and on `429`. An organization on the unlimited
tier gets no rate limit headers.

## When you are limited

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

```json theme={null}
{
  "code": "RATE_LIMIT_EXCEEDED",
  "message": "Too many requests. Wait for the time in the Retry-After header."
}
```

A failed request still counts. A `400` or a `404` spends one request like any other.

## Staying under the limit

* **Keep what changes rarely.** A config never changes. The chain list, the category list, a
  search answer and a charity's profile do not change from minute to minute.
  [What to keep](https://docs.donate.gg/api/overview.md#what-to-keep-and-for-how-long) lists them.
* **Ask for many references at once.** `GET /v2/beneficiaries/lookup?ids=` resolves up to 100 recipients
  in one request.
* **Wait for `Retry-After`** before you retry a `429`.
* **Watch `X-RateLimit-Remaining`** and slow down before you reach zero.
* **Debounce search.** Send a search when the person pauses typing, not on every key.
* **Poll at the pace the data moves.** [Track a donation](https://docs.donate.gg/guides/track-a-donation.md#poll-and-how-often)
  suggests intervals.

## Runnable check

```bash theme={null}
# The rate limit headers on any response
curl -s -D - -o /dev/null "https://api.donate.gg/api/v2/categories" | grep -i "x-ratelimit"
```


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