5

I have registered an app at https://stackapps.com/apps/register, got a Key right away after I have submitted.

But now when I request http://api.stackoverflow.com/0.8/stats?key=MYKEY, I got RequestLimitExceeded Error

{
  "error": {
    "code": "RequestLimitExceeded",
    "message": "This IP has exceeded the request-per-day limit."
  }
}

Note: I have reached 300 requests, but not 10k for sure :)


Ok, Now I fixed it by changing my IP Address (Glad I am at home)

X-RateLimit-Max 100000
X-RateLimit-Current 99998

And I just noticed that key is need to set for the first time only.

Once first request is success and got X-RateLimit-Max in response header, you don't need to set key an API URL anymore for the whole day.

YOU
  • 5,022
  • 18
  • 18

2 Answers2

4

Did you make any requests earlier today without a key?

The API only checks your key and sets a limit on the first request.

A single IP address can only make a limited number of requests per day to the API. This limit is determined at first request time, and is dependent upon the presence of an API key.

Joel
  • 4,784
  • 1
  • 13
  • 12
2

A help request in the browser will trigger the daily max cap. The SO team has set different request limits on the help requests (yesterday it was 300, but today it's 100000). So, by making stats?help (no key) request your first request for the day, you're 'hacking' your daily cap to 100000. :-)

I suspect this hack won't last long, so use it while it's there...

Franci Penov
  • 2,894
  • 14
  • 12