Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Examples of HTTP API Rate Limiting HTTP Response headers

One of the Additional HTTP Status Codes (RFC6585) is

  • 429 Too Many Requests

Where can I find examples of HTTP / REST API Rate-Limiting HTTP response headers that are useful with this HTTP response status?

like image 978
M8R-1jmw5r Avatar asked Apr 15 '13 18:04

M8R-1jmw5r


People also ask

How do I limit responses from API?

Setting a timeout is the easiest way to limit API requests. Just set the timeout limit and then return the following message to your users.

What are API response headers?

API headers are like an extra source of information for each API call you make. Their job is to represent the meta-data associated with an API request and response. If you ever encounter issues with an API, the first place you should look is the headers, since they can help you track down any potential issues.


1 Answers

Here are some examples of HTTP API Rate Limiting HTTP Response headers. Taken from four common REST APIs: Github, Vimeo, Twitter and Imgur:

Github Rate Limiting http://developer.github.com/v3/#rate-limiting

#=============================#=============================================# # HTTP Header                 # Description                                 # #=============================#=============================================# | X-RateLimit-Limit           | Request limit per hour                      | +-----------------------------+---------------------------------------------+ | X-RateLimit-Remaining       | The number of requests left for the time    | |                             | window                                      | +-----------------------------+---------------------------------------------+ 

Vimeo Rate Limiting http://developer.vimeo.com/guidelines/rate-limiting

#=============================#=============================================# # HTTP Header                 # Description                                 # #=============================#=============================================# | X-RateLimit-Limit           | Request limit per day / per 5 minutes       | +-----------------------------+---------------------------------------------+ | X-RateLimit-Remaining       | The number of requests left for the time    | |                             | window                                      | +-----------------------------+---------------------------------------------+ | X-RateLimit-Reset           | The remaining window before the rate limit  | |                             | resets in UTC epoch seconds                 | +-----------------------------+---------------------------------------------+ 

Twitter REST API Rate Limiting https://dev.twitter.com/docs/rate-limiting/1.1

Note: Twitter uses headers with similar names like Vimeo, but has another dash in each name.

#=============================#=============================================# # HTTP Header                 # Description                                 # #=============================#=============================================# | X-Rate-Limit-Limit          | The rate limit ceiling for that given       | |                             | request                                     | +-----------------------------+---------------------------------------------+ | X-Rate-Limit-Remaining      | The number of requests left for the         | |                             | 15 minute window                            | +-----------------------------+---------------------------------------------+ | X-Rate-Limit-Reset          | The remaining window before the rate limit  | |                             | resets in UTC epoch seconds                 | +-----------------------------+---------------------------------------------+ 

Imgur API Rate Limits http://api.imgur.com/

#=============================#=============================================# # HTTP Header                 # Description                                 # #=============================#=============================================# | X-RateLimit-UserLimit       | Total credits that can be allocated         | +-----------------------------+---------------------------------------------+ | X-RateLimit-UserRemaining   | Total credits available                     | +-----------------------------+---------------------------------------------+ | X-RateLimit-UserReset       | Timestamp (unix epoch) for when the credits | |                             | will be reset                               | +-----------------------------+---------------------------------------------+ | X-RateLimit-ClientLimit     | Total credits that can be allocated for the | |                             | application in a day                        | +-----------------------------+---------------------------------------------+ | X-RateLimit-ClientRemaining | Total credits remaining for the application | |                             | in a day                                    | +-----------------------------+---------------------------------------------+ 
like image 172
M8R-1jmw5r Avatar answered Oct 16 '22 22:10

M8R-1jmw5r