Core Concepts
Rate Limiting
Cresora API request limits and how to handle 429 responses gracefully.
Cresora rate-limits API requests per Partner key to protect platform stability.
Limits
| Scope | Limit |
|---|---|
| Per Partner key | 1,000 requests / minute |
| Burst | Short bursts above the limit are allowed for up to 10 seconds |
429 response
When you exceed the limit, Cresora returns:
HTTP 429 Too Many Requests
Retry-After: 12The Retry-After header gives the number of seconds to wait before retrying.
Handling rate limits
Implement exponential backoff with jitter:
async function requestWithRetry(fn, maxRetries = 3) {
for (let attempt = 0; attempt <= maxRetries; attempt++) {
try {
return await fn();
} catch (err) {
if (err.status === 429 && attempt < maxRetries) {
const retryAfter = parseInt(err.headers?.["retry-after"] ?? "1", 10);
const jitter = Math.random() * 1000; // 0–1 second jitter
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000 + jitter));
continue;
}
throw err;
}
}
}import time, random, requests
def request_with_retry(fn, max_retries=3):
for attempt in range(max_retries + 1):
resp = fn()
if resp.status_code == 429 and attempt < max_retries:
retry_after = int(resp.headers.get("Retry-After", 1))
jitter = random.random()
time.sleep(retry_after + jitter)
continue
return resp
return resp💡Tip
If you consistently hit rate limits, batch operations where possible or distribute load across time. Contact Cresora if your use case requires higher limits.
Rate limit headers
All API responses include headers so you can track your usage proactively:
| Header | Value |
|---|---|
X-RateLimit-Limit | Your per-minute limit |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the window resets |