Skip to main content
Cresora Commerce
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

ScopeLimit
Per Partner key1,000 requests / minute
BurstShort 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: 12

The Retry-After header gives the number of seconds to wait before retrying.

Handling rate limits

Implement exponential backoff with jitter:

Node.js
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;
    }
  }
}
Python
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:

HeaderValue
X-RateLimit-LimitYour per-minute limit
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the window resets