2

I am trying to fetch API data from:
    api.stackexchange.com/2.2/questions?site=stackoverflow...

But I am getting the error:

{error_id: 502, error_message: "too many requests from this IP, more requests available in 24527 seconds", error_name: "throttle_violation"}

I saw this answer:
  Stack Exchange API too many requests from this IP address

But, I'm not able to understand how to set backoff to 10. Do we have to edit it?

Is there some way to resolve this issue?

1
  • Not a bug, works fine for me. Commented Aug 10, 2018 at 1:45

1 Answer 1

7

The backoff property is not something you set. It is the number of seconds your app must wait before making another API call.

So, if you get backoff: 10 in the response, wait 10 seconds before calling the API again.

However, it's not clear that that's the issue. Unlike some other calls, the call listed in your question does not automatically trigger a backoff.

Is there any chance that you've just made more than 300 API calls in the last 24 hours?


Steps to resolve:

  1. Always, always, always monitor the response for the backoff, error_id, error_message, error_name, and quota_remaining properties.
  2. Appropriately act on the above if they are present or if the quota_remaining gets close to zero.
  3. Register your app for an API key. This allows you to have a 10K quota instead of 300.
  4. Send your API key with every API call or POST.
  5. Be aware of high "cost" API calls, as these are the ones most likely to trigger a backoff. (See the warning at the paging docs and also Nick Craver's answer)

You must log in to answer this question.

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