Rate limiting
To ensure stability and fair usage across all companies, the Scalar API enforces rate limits on all requests.
Limits
Rate limits are applied at the company level. Every request made with an API key counts towards the limit for the company associated with that key.
- Standard limit: Defined in your company settings (default is often 5,000 requests per hour).
- Scope: Limits apply to the entire
/api/v1/namespace.
Exceeding the limit
If you exceed the rate limit, the API will return an HTTP 429 (Too Many Requests) error.
Error response body
{
"detail": "Request was throttled. Expected available in 3600 seconds."
}
Handling rate limits
When your application receives an HTTP 429 response:
- Check the 'Retry-After' header: The API includes a
Retry-Afterheader indicating how many seconds to wait before retrying the request. - Back off: Implement an exponential backoff strategy for retries.
- Optimise requests: Use pagination effectively and only fetch data when necessary.
Monitoring usage
While we do not currently provide an endpoint to check your remaining quota, you can monitor your usage by tracking the number of successful and throttled requests in your own integration logs.
