Skip to main content

Rate Limiting

Overall request limits

The API is rate-limited to 150 requests every 60 seconds. All requests count towards the total. Every request processed by the API returns rate limiting information in the HTTP headers.


Note: Rate limiting is based on both username and ip address. Therefore a single username is limited to 150 requests every 60 seconds, as is a single IP address.


Statistics request limits

Statistics requests are rate limited to 30 requests per minute for each IP address and 25 requests per minute for each username.


Note: The IP and username of every statistics request made will count towards these limits.


For example, if you log in with your username on a single computer and make 25 statistics requests, the next one you make will fail. However, you could change to a different username and make 5 more statistics requests, before hitting the IP address limit.

Examples

Rate Limiting - Example 1


$ curl -i https://api.example.com/v2/statistics/a/date


{
"HTTP/1.1": "200 OK",
"Date": "Fri, 24 Oct 2014 14:57:32 GMT",
"Content-Type": "application/json",
"Transfer-Encoding": "chunked",
"X-Rate-Limit-Limit": 25,
"X-Rate-Limit-Remaining": 44,
"X-Rate-Limit-Reset": 27
}

When the rate limit is exceeded a 429 Too Many Requests HTTP error will be thrown by any subsequent requests until the rate limit is reset. As with a normal request the rate limiting information will be available in the HTTP headers.

Rate Limiting - Example 2 (Limit Exceeded)


$ curl -i https://api.example.com/v2/statistics/a/date


{
"HTTP/1.1": "429 Too Many Requests",
"Date": "Fri, 24 Oct 2014 15:04:35 GMT",
"Content-Type": "application/json",
"Transfer-Encoding": "chunked",
"X-Rate-Limit-Limit": 25,
"X-Rate-Limit-Remaining": 0,
"X-Rate-Limit-Reset": 12
}