Something API users may not be aware of, is that the Solcast API has (at the time of writing) a default rate limit of 120 requests per minute per user.
If you’re using one of our client libraries like
solcast-py for Python, you won’t need to worry about this as it already handles batching requests to fall within the rate limit.
If you’re just using a plain HTTP client to make requests to the Solcast API, there are response headers that you can read to make you client handle being rate limited easier.
x-rate-limitspecifies what the rate limit is per minute.
x-rate-limit-remainingspecifies how many additional requests you can make until the rate limit is exceeded.
x-rate-limit-resetspecifies when (UTC in Unix Time format) the limit will reset
If you do happen to exceed you rate limit, you will receive a
429 status code in return, indicating you have exceeded your limit.
The simplest way to handle this in a client is to:
- Handle error responses
- Check if it is a
- Deduct the
nowin UTC in Unix standard from
- Wait the number of seconds that results from step 3 and continue from the last request made.
This will ensure you can get the most out of the Solcast API!
Hopefully the above will makes things easier for users hitting the rate limit. What kind of tools/programming languages/etc are others using to access the API?