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

# Rate Limiting

> Understand API rate limits and how the SDK handles them automatically.

## Overview

The API enforces rate limits to ensure stability for all users.

## Limits

| Endpoint Type           | Limit                     |
| ----------------------- | ------------------------- |
| Read operations (GET)   | 1,000 requests per minute |
| Write operations (POST) | 100 requests per minute   |

## Rate Limit Headers

Every response includes rate limit information:

```http theme={null}
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 1705312800
```

## Handling Rate Limits

When you exceed the limit, you'll receive a `429 Too Many Requests` response:

```json theme={null}
{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Please retry after 32 seconds.",
    "retry_after": 32
  }
}
```

## Automatic Retries

The SDK automatically handles rate limiting with built-in retries and exponential backoff. You can customize this behavior:

```typescript theme={null}
const factify = new Factify({
  bearerAuth: process.env.FACTIFY_KEY,
  retryConfig: {
    strategy: "backoff",
    backoff: {
      initialInterval: 1000,
      maxInterval: 30000,
      exponent: 1.5,
      maxElapsedTime: 60000,
    },
    retryConnectionErrors: false,
  },
});
```

<Info>
  You can also monitor your quota usage in the [Developer Dashboard](https://platform.factify.com).
</Info>

## Best Practices

1. **Use pagination** - Fetch data in smaller batches rather than requesting everything at once
2. **Cache responses** - Store frequently accessed data locally to reduce API calls
3. **Monitor headers** - Track `X-RateLimit-Remaining` to avoid hitting limits
4. **Implement backoff** - The SDK handles this automatically, but be aware of retry behavior
