Common Patterns
Rate Limits
The Qwetty API enforces rate limits to ensure fair usage and system stability.
Limits
| Tier | Limit |
|---|---|
| Standard | 1,000 requests per hour |
| Admin | 5,000 requests per hour |
Rate limits are applied per API key.
Rate limit headers
Every response includes rate limit information:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests in the current window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
Handling rate limits
When you exceed the limit, the API returns 429 Too Many Requests:
Code
Backoff strategy
Implement exponential backoff:
Code
Best practices
- Monitor remaining requests using the
X-RateLimit-Remainingheader - Batch operations where possible to reduce request count
- Cache responses for data that doesn't change frequently
- Use webhooks instead of polling for real-time updates
Next steps
- Error Handling — Handle all API errors
- Webhooks — Real-time event notifications
Last modified on