HTTP 429 Too Many Requests status code. This error indicates that you have sent too many requests in a given amount of time, exceeding the rate limits defined for your API plan.
This document explains why you’re seeing this error and what steps you can take to resolve and prevent it.
Understanding Geekflare API Rate Limits
To ensure fair usage and provide consistent performance for all users, Geekflare enforces rate limits on API requests. These limits specify the maximum number of requests you can make requests per second. Your specific rate limits are determined by your active Geekflare API plan. Refer to API Pricing for detailed information on the rate limits associated with each plan.
When a 429 Error Occurs
When a429 Too Many Requests error occurs, the Geekflare API will return an HTTP 429 status code.
Example API Response:
Retry-After(Header): This header indicates the number of seconds you should wait before making another request. Always respect this value.X-RateLimit-Limit-Second(Header): The maximum number of requests allowed per second for your plan.X-RateLimit-Remaining(Header): The number of requests remaining in the current time window. When this hits0, you’ll likely receive a 429.
How to Resolve & Prevent 429 Errors
Encountering a 429 error is a signal to adjust your request patterns. Here are the recommended steps:-
Wait and Retry (Respect
Retry-After)- The simplest and most direct solution. When you receive a
429error, pause your requests for at least the number of seconds specified in theRetry-Afterheader. After this period, you can safely retry your original request. - Do NOT immediately retry without waiting, as this will only exacerbate the problem and might lead to temporary IP blocking if repeated excessively.
- The simplest and most direct solution. When you receive a
-
Implement Exponential Backoff with Jitter
- For more robust applications, especially when dealing with intermittent rate limits or other transient errors, implement an exponential backoff strategy.
- How it works: If a request fails, wait a short period (e.g., 5 second) before retrying. If it fails again, double the wait time (10 seconds), then (15 seconds), and so on, up to a maximum number of retries or a maximum wait time.
- Add Jitter: To prevent all your clients from retrying at the exact same moment, add a small random delay (jitter) to your backoff period. For example, instead of waiting exactly 2 seconds, wait between 1.5 and 2.5 seconds.
-
Monitor Your Usage Proactively
- In your successful API responses, always look at the
X-RateLimit-Remainingheader. This tells you how many requests you have left in the current window. - By monitoring this header, you can anticipate hitting your limit and adjust your request pace before receiving a 429 error.
- In your successful API responses, always look at the
-
Upgrade Your Plan
- If you consistently hit rate limits and your application genuinely requires higher throughput than your current plan allows, the most effective solution is to upgrade your Geekflare API plan.
- Higher-tier plans come with significantly increased rate limits.
- Login to Dashboard and Upgrade
-
Contact Support
- If you believe you are encountering rate limits in error, or if you have a unique use case that requires custom rate limits beyond our standard plans, please don’t hesitate to contact our support team.
- Provide as much detail as possible, the approximate time of the errors, and your expected usage patterns.