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

# Rate Limits

> API rate limits and how to handle them.

# Rate Limits

Rate limits vary by plan tier. When you exceed your limit, the API returns
HTTP 429 with a `Retry-After` header.

## Limits by plan

| Plan       | Requests/minute | Requests/day |
| ---------- | --------------- | ------------ |
| Free       | 30              | 1,000        |
| Pro        | 120             | 50,000       |
| Enterprise | Custom          | Custom       |

## Rate limit headers

Every response includes these headers:

```
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 117
X-RateLimit-Reset: 1714567890
```

## Handling 429 responses

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

def fetch_with_retry(url, headers, max_retries=3):
    for attempt in range(max_retries):
        response = requests.get(url, headers=headers)
        if response.status_code == 429:
            wait = int(response.headers.get("Retry-After", 60))
            time.sleep(wait)
            continue
        return response
    raise Exception("Rate limit exceeded after retries")
```

## Best practices

* Cache responses locally when possible
* Use bulk endpoints (export bundle, library) instead of per-series calls
* Spread requests evenly rather than bursting
