Skip to main content

Overview

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

Limits

Endpoint TypeLimit
Read operations (GET)1,000 requests per minute
Write operations (POST)100 requests per minute

Rate Limit Headers

Every response includes rate limit information:
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:
{
  "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:
const factify = new Factify({
  bearerAuth: process.env.FACTIFY_KEY,
  retryConfig: {
    strategy: "backoff",
    backoff: {
      initialInterval: 1000,
      maxInterval: 30000,
      exponent: 1.5,
      maxElapsedTime: 60000,
    },
    retryConnectionErrors: false,
  },
});

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