Rate Limits
Understanding and working with refile API rate limits
Rate Limits
To ensure fair usage and system stability, refile API implements rate limiting. This guide explains how rate limits work, how to monitor your usage, and best practices for working with these limits.
Our rate limits are designed to be generous for normal API usage patterns. For those building high-volume applications, we recommend implementing proper rate limit handling as described below.
Current Rate Limits
We currently apply a standard rate limit of 200 requests per minute for all API endpoints. This limit is applied based on your API key (for authenticated requests) or IP address (for unauthenticated requests).
If you’re not interested in the technical details, you don’t need to worry about rate limits unless you’re making a large number of requests in a short period.
Rate Limit Headers
When you make requests to the refile API, you’ll receive rate limit information in the response headers:
Header | Description |
---|---|
X-RateLimit-Limit | The maximum number of requests allowed in the current time window (200) |
X-RateLimit-Remaining | The number of requests remaining in the current time window |
X-RateLimit-Reset | The time at which the current rate limit window resets (Unix timestamp in seconds) |
You can use these headers to monitor your rate limit status and implement appropriate request handling strategies in your applications.
Example Response Headers
Rate Limit Exceeded
If you exceed the rate limit, the API will respond with a 429 Too Many Requests
HTTP status code and the following JSON body:
Best Practices
To avoid hitting rate limits, consider the following best practices:
1. Monitor Your Usage
Monitor the rate limit headers in API responses to track your remaining request quota. This allows you to adjust your request rate if necessary.
2. Implement Backoff Strategies
When you receive a 429 response, implement an exponential backoff strategy:
3. Queue and Batch Requests
If your application needs to make many requests, consider queueing them and processing them at a controlled rate. You can also batch operations where possible to reduce the number of API calls.
Need Higher Limits?
If you require higher rate limits for your application, please contact us at help@refile.co to discuss your needs.