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

# Rate Limits

> Understand and work within API rate limits

The API enforces rate limits per API key to ensure fair usage and service reliability.

## Default limits

| Limit               | Value                |
| ------------------- | -------------------- |
| Requests per minute | 60                   |
| Window              | 60 seconds (sliding) |

## Rate limit headers

Every response includes headers showing your current usage:

| Header                  | Description                           |
| ----------------------- | ------------------------------------- |
| `X-RateLimit-Limit`     | Maximum requests allowed per window   |
| `X-RateLimit-Remaining` | Requests remaining in current window  |
| `X-RateLimit-Reset`     | Unix timestamp when the window resets |

## When you hit the limit

If you exceed the rate limit, the API returns a `429` response with a `Retry-After` header:

```json theme={null}
{
	"error": {
		"code": "rate_limited",
		"message": "Rate limit exceeded. Retry after 12 seconds.",
		"request_id": "req_abc123"
	}
}
```

```
HTTP/1.1 429 Too Many Requests
Retry-After: 12
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1714060800
```

## Best practices

<AccordionGroup>
  <Accordion title="Use exponential backoff">
    When you receive a 429, wait for the `Retry-After` duration before retrying. If retries continue
    to fail, increase the wait time exponentially.
  </Accordion>

  <Accordion title="Cache responses locally">
    If you're reading the same data repeatedly, cache it locally and use `updated_since` for
    incremental updates instead of re-fetching everything.
  </Accordion>

  <Accordion title="Use larger page sizes">
    Set `limit=100` to fetch more results per request, reducing the total number of API calls
    needed.
  </Accordion>
</AccordionGroup>

## Need higher limits?

If your integration requires a higher rate limit, contact [partners@civicmarketplace.com](mailto:partners@civicmarketplace.com) with details about your use case.
