Overview
The Anderro API enforces rate limits to ensure fair usage and platform stability. Rate limits are applied per API key (per product).
Current limits
| Scope | Limit |
|---|---|
All /api/v1/* endpoints | 60 requests per minute per API key |
Rate limit headers
Every API response includes headers indicating your current rate limit status:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed per window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Seconds 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.
Recommended approach
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