Rate Limits
The Storeep API enforces rate limits per access token to ensure fair usage and service stability.
Limits
| Metric | Limit |
|---|---|
| Requests per minute | 60 per token |
| Window duration | 60 seconds (sliding window) |
Rate limits are enforced per token, not per store. If you have multiple tokens, each has its own independent rate limit.
Rate Limit Exceeded
When you exceed the rate limit, the API returns a 429 Too Many Requests response:
429 Too Many Requests
{
"status": "error",
"errors": [
"rate limit exceeded, try again later"
]
}How the Window Works
- The window starts with your first request and lasts 60 seconds.
- Each request within the window increments the counter.
- When the counter reaches 60, subsequent requests are rejected with
429. - After the 60-second window expires, the counter resets and a new window begins.
Handling Rate Limits
Implement these patterns to avoid hitting rate limits:
Exponential Backoff
When you receive a 429 response, wait before retrying. Increase the wait time with each retry.
JavaScript
async function fetchWithRetry (url, options, retries = 3)
{
for (let i = 0; i < retries; i++)
{
const response = await fetch(url, options);
if (response.status !== 429) return response;
// wait 2^i seconds before retrying
await new Promise(r => setTimeout(r, Math.pow(2, i) * 1000));
}
throw new Error("Rate limit exceeded after retries");
}Request Batching
Instead of making many individual requests, use pagination efficiently:
- Use the maximum
limit=50to reduce the number of requests needed. - Follow
meta.pagination.links.nextfor subsequent pages. - Space requests at least 1 second apart to stay within limits.
Multiple Tokens
For high-throughput integrations, create multiple tokens and distribute requests across them. Each token has an independent 60 req/min limit.