Rate Limits

Understand rate limiting policies and headers for the Anderro API.

Overview

The Anderro API enforces rate limits to ensure fair usage and platform stability. Rate limits are applied per API key.

Current limits

ScopeLimit
All /api/v1/* endpoints, product key60 requests per minute per product
All /api/v1/* endpoints, organization or account key120 requests per minute per key

If your app shows Anderro data to many users, cache responses on your server for a minute or more rather than calling the API on every page view.

Rate limit headers

Every API response includes headers indicating your current rate limit status:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed per window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetSeconds until the rate limit window resets

Handling rate limits

When you exceed the rate limit, the API returns HTTP 429 Too Many Requests:

json
{
  "error": "Rate limit exceeded. Retry after 45 seconds."
}

The response includes a Retry-After header with the number of seconds to wait before retrying.

javascript
async function fetchWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    const res = await fetch(url, options);

    if (res.status === 429) {
      const retryAfter = parseInt(res.headers.get("Retry-After") || "60", 10);
      await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000));
      continue;
    }

    return res;
  }

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

Best practices

  • Cache responses when possible to reduce API calls.
  • Use webhooks for real-time notifications instead of polling.
  • Batch operations - use the bulk endpoints when registering or removing multiple affiliates.
  • Implement exponential backoff when retrying after rate limit errors.

Request ID

Every API response includes an X-Request-Id header with a unique identifier for that request. Include this ID when contacting support for faster debugging.

X-Request-Id: 550e8400-e29b-41d4-a716-446655440000