Skip to main content
The Chariow API implements rate limiting to ensure fair usage and maintain service quality for all users.

Default Limits

Endpoint TypeLimitWindow
All API requests100 requestsper minute
Rate limits are applied per API key. Each API key has its own separate limit counter.

Rate Limit Headers

Every API response includes headers indicating your current rate limit status:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1642089600
HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the window
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when the limit resets

Rate Limit Exceeded

When you exceed the rate limit, you’ll receive a 429 Too Many Requests response:
{
  "message": "Rate limit exceeded. Please retry after 60 seconds.",
  "data": [],
  "errors": []
}
The response includes a Retry-After header indicating how long to wait:
HTTP/1.1 429 Too Many Requests
Retry-After: 60

Handling Rate Limits

Exponential Backoff

Implement exponential backoff to gracefully handle rate limits:
async function fetchWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    const response = await fetch(url, options);

    if (response.status === 429) {
      const retryAfter = response.headers.get('Retry-After') || 60;
      const delay = Math.min(retryAfter * 1000, Math.pow(2, attempt) * 1000);

      console.log(`Rate limited. Retrying in ${delay}ms...`);
      await new Promise(resolve => setTimeout(resolve, delay));
      continue;
    }

    return response;
  }

  throw new Error('Max retries exceeded');
}

Request Batching

Batch multiple operations to reduce request count:
// Instead of making 100 individual requests
for (const customerId of customerIds) {
  await getCustomer(customerId); // 100 requests
}

// Use pagination to get multiple at once
const customers = await listCustomers({ per_page: 100 }); // 1 request

Caching

Cache responses to avoid unnecessary requests:
const cache = new Map();
const CACHE_TTL = 60000; // 1 minute

async function getCachedCustomer(customerId) {
  const cached = cache.get(customerId);

  if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
    return cached.data;
  }

  const response = await fetch(`/v1/customers/${customerId}`, {
    headers: { 'Authorization': `Bearer ${apiKey}` }
  });

  const data = await response.json();
  cache.set(customerId, { data, timestamp: Date.now() });

  return data;
}

Increasing Limits

If you need higher rate limits:
  1. Enterprise Plans - Higher limits are available on enterprise plans
  2. Contact Support - Request a temporary increase for specific use cases
  3. Optimize Usage - Review your implementation for optimization opportunities
Contact [email protected] to discuss higher rate limits for your use case.

Best Practices

Track rate limit headers to understand your usage patterns and adjust accordingly.
Instead of polling for changes, use webhooks to receive real-time notifications.
Queue requests and process them at a controlled rate to avoid bursts.
Cache data that doesn’t change frequently to reduce API calls.