Rate Limiting
API requests are rate-limited per API key to ensure fair usage.
Default limits
| Endpoint type | Limit |
|---|---|
| GET endpoints | 100 requests/minute |
| POST endpoints | 50 requests/minute |
| Batch endpoints | 20 requests/minute |
Response headers
Every response includes rate limit headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in the current window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
Retry-After | Seconds to wait before retrying (only on 429) |
Handling rate limits
When you exceed the limit, the API returns 429 Too Many Requests:
{
"error": "Too many requests. Please try again later."
}Use the Retry-After header to wait the appropriate amount of time:
const response = await fetch("https://crelio.app/api/v1/social-posts", {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
if (response.status === 429) {
const retryAfter = parseInt(response.headers.get("Retry-After") || "60");
await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000));
// Retry the request
}Best practices
- Cache responses when possible (e.g., account lists don't change frequently)
- Use batch endpoints instead of creating posts one by one
- Implement exponential backoff for retries
- Monitor
X-RateLimit-Remainingto avoid hitting limits