Communicating rate limiting status in API responses - any standard or best practices?

78 views
Skip to first unread message

Cooper Marcus

unread,
Aug 20, 2015, 12:18:32 PM8/20/15
to api-...@googlegroups.com
As I prepare to implement rate limiting on some APIs, I've been considering how to communicate, to API clients, the "status" of their rate limit. The purpose of this communication it to allow API clients to adjust their behavior - for example, if the client is told "you are only 10 calls away from your rate limit, and your limit will reset in 30 minutes", the client might adjust its call frequency to once per 3 mins. 

Github commuicates rate limit status via HTTP headers as noted here https://developer.github.com/v3/#rate-limiting

Is that the best approach? Are there other approaches you like? Are there any standards or best practices?

Thanks, Cooper

jeff fitzgerald

unread,
Aug 21, 2015, 2:58:20 PM8/21/15
to API Craft
Twitter, Instagram, Hipchat, 4Square and others are all using the same pattern as Github. Given how many APIs have adopted this convention, that should be enough to make it a best practice, if not a standard.

Good API patterns and conventions will almost always bubble to the top. This is one of them.

mca

unread,
Aug 21, 2015, 3:00:17 PM8/21/15
to api-...@googlegroups.com
might be worth proposing this as a new header to IETF.

--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+...@googlegroups.com.
Visit this group at http://groups.google.com/group/api-craft.
For more options, visit https://groups.google.com/d/optout.

jeff fitzgerald

unread,
Aug 21, 2015, 4:05:47 PM8/21/15
to API Craft
+1 mike.
Reply all
Reply to author
Forward
0 new messages