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

# Rate Limits

> Rate limits and usage guidelines for the Factagora API

## Overview

The Factagora API enforces rate limits to ensure fair usage and service stability. Limits vary by endpoint type.

| Endpoint type                                                                                                                              | Limit                       |
| ------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------- |
| Search endpoints (e.g. `/fact-search`, `/search`)                                                                                          | **600 req/min** per API key |
| Analysis endpoints (e.g. `/fact-checker`, `/evidence-finder`, `/generate`, `/deep-research`, `/timeseries`, `/causality-graph`, `/ingest`) | **60 req/min** per API key  |

## Response Headers

Every API response includes the following headers:

| Header                  | Description                                             |
| ----------------------- | ------------------------------------------------------- |
| `X-RateLimit-Limit`     | Maximum requests allowed per minute                     |
| `X-RateLimit-Remaining` | Remaining requests in the current window                |
| `Retry-After`           | Seconds to wait before retrying (only on 429 responses) |

## Rate Limit Exceeded

When you exceed the rate limit, the API returns a `429 Too Many Requests` response:

```json theme={null}
{
  "error": "Too Many Requests",
  "message": "Rate limit exceeded. Try again in 30s",
  "statusCode": 429
}
```

## Handling Rate Limits

Use the `Retry-After` header to wait the appropriate amount of time before retrying:

<CodeGroup>
  ```python Python theme={null}
  import requests
  import time

  def request_with_retry(url, headers, params):
      response = requests.get(url, headers=headers, params=params)

      if response.status_code == 429:
          retry_after = int(response.headers.get("Retry-After", 60))
          time.sleep(retry_after)
          return request_with_retry(url, headers, params)

      return response
  ```

  ```typescript TypeScript theme={null}
  async function requestWithRetry(url: string, headers: Record<string, string>) {
    const response = await fetch(url, { headers });

    if (response.status === 429) {
      const retryAfter = Number(response.headers.get("Retry-After") ?? 60);
      await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000));
      return requestWithRetry(url, headers);
    }

    return response;
  }
  ```
</CodeGroup>

<Note>
  If you consistently hit rate limits, consider batching requests or upgrading your plan. See [Credits & Pricing](/credits-pricing) for details.
</Note>
