SolarNet API rate limiting - SolarNetwork/solarnetwork GitHub Wiki
SolarNetwork enforces rate limits across different parts of the API. If an application makes
requests faster than what SolarNetwork allows, an HTTP 429 TOO_MANY_REQUESTS
status will be
returned. If your application does get a 429
response, then the application could decide to
back-off and make requests more slowly (after a small wait period) or to give up. The rate policy is
enforced per SolarNetwork application (for example SolarQuery, SolarUser) along with the security
token used (or for public APIs at the requestor’s IP address). At the moment the request rate is
limited to roughly 10/s, with bursts up to 20/s.
The purpose of the rate limiting is to help with SolarNetwork system stability and reliability. This is not a “pay more for more access” type rate limit that some services offer. SolarNetwork already has metering in place for API usage and charges based on that use, and SolarNetwork's goal is to handle as many API requests as possible, as fast as possible, within reasonable resource limitations imposed by our physical infrastructure. We continuously monitor our resource use and make changes over time to match our average utilisation, and will adjust the rate limiting over time to best fit those resources.
Rate-limited API calls include the following response headers:
Header | Description |
---|---|
X-SN-Rate-Limit-Remaining |
Returned on success responses, and will be an integer count of the remaining requests available to the same rate policy, at the time this request was processed. When this reaches 0 then another immediate request is likely to return a 429 response. |
X-SN-Rate-Limit-Retry-After |
Returned on 429 responses, and will be a millisecond Unix epoch after which another request to the same rate policy will succeed. |