Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

Twitter has the ability as part of its API to query the current rate limit status. Going to this url will show you how many requests can be made before the limit is reached:

{"remaining_hits":150,  
 "hourly_limit":150,
 "reset_time_in_seconds":1274399014,
 "reset_time":"Thu May 20 23:43:34 +0000 2010"}

Requests to this url also do not count towards the limit.

Is there a similar ability with the SO API? If so, how is it done?

share|improve this question
    
Should be tagged as feature-request. –  systempuntoout Jun 7 '10 at 12:49

1 Answer 1

up vote 13 down vote accepted

I imagine a /status method would not be too hard, and is crucial in both testing and deploying applications.

Imagine an application that updates a database with new questions. It can query the /status method to correctly time it's calls so that it can make it through the day.

I would also consider whether this call should count towards the limit. Twitter, for instance, doesn't count a /status call against the limit.


Actually, it is included in all headers. From Chrome, here is what I get back:

Cache-Control:private
Connection:keep-alive
Content-Encoding:gzip
Content-Length:5158
Content-Type:application/json;
charset=utf-8 Date:Thu, 20 May 2010
23:18:10 GMT Server:nginx
X-AspNet-Version:2.0.50727
X-AspNetMvc-Version:2.0
X-RateLimit-Current:298
X-RateLimit-Max:300

share|improve this answer
    
I'd agree that it shouldn't count towards the limit, otherwise just simply asking if you are over the limit could put you over the limit :) –  adrianbanks May 20 '10 at 22:59
    
I thought that was the case. –  Joel Potter May 21 '10 at 0:03
    
I think that these RateLimit headers should be documented. Also, I believe that Twitter's API, for example, uses this header approach, as well as a /status method. Shouldn't we implement the latter, too (having /status not count against the rate limit, of course)? –  Maxim Zaslavsky May 21 '10 at 17:52
6  
I dislike the header method. I really think this should be added to /status as well. –  Matt S. May 25 '10 at 22:55
    
+1 for /status proposal. –  systempuntoout Jun 7 '10 at 12:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .