API Rate Limiting Guide
Our APIs enforce rate limits on incoming requests to ensure fair usage and maintain application performance. This guide explains how rate limiting works, what happens when limits are exceeded, and how you can handle rate-limited responses effectively.
How Rate Limiting Works
Rate limits define the maximum number of API requests a user can make within a specific time frame. These limits:
Apply per user.
Default to a per-minute limit.
Apply to API requests made to the Squad backend.
If a user exceeds their allocated limit, the API will reject further requests until the rate limit resets.
Response When Rate Limits Are Exceeded
If a request exceeds the allowed limit, the API returns an HTTP 429 Too Many Requests response, along with a Retry-After header specifying the wait time before retrying.
Example response:
HTTP/1.1 429 Too Many Requests Content-Type: application/json Retry-After: 60 { "error": "Rate limit exceeded", "message": "You have exceeded the allowed request limit. Please wait for 60 seconds before retrying." }
How to Handle Rate Limits
To ensure smooth API interactions and avoid disruptions:
Monitor your request patterns. Optimize API calls to stay within the limit.
Implement exponential backoff. Instead of retrying immediately, wait for the duration specified in the Retry-After header.
Use caching when possible. Avoid redundant API requests for frequently accessed data.
By following these best practices, you can ensure uninterrupted access to our APIs while maintaining system reliability for all users.
For more information, please contact our support team.