API Stackoverflow, "quota_max"

Asked

Viewed 117 times

2

Hello, I am using a collector to fetch data from all users of stackoverflow forum by API. Except I’m suffering from the "quota_max" which is only 300 searches a day. I already tried with the Sleep function, put the collector to sleep up to 300 seconds per search, and yet it fills the quotas and stops returning. Someone might know a way to search the api non-stop (if possible) or how quota replenishment works?

  • Can you explain your problem in terms of code? Can’t use any cache? You’re using access_token? Read the documentation?

  • 4

    You need an API key to expand this number. In that reply you will see that with a key you can have up to 10,000 requests while the limit will continue to 300 if you do not have it. Sure, you can even get information from users without key, but it will have to be 300 per day.

  • My python code collects directly from the api site ranging only from the page number to be searched. Each page returns me 100 users, and I need all users. As much as I try to register to get a key, I don’t know how to use it

  • 2

    @Pythowner Don’t just pass her on query string? Like, if you’re doing http://api.stackexchange.com/2.2/users?page=1&order=desc&sort=reputation&site=pt.stackoverflow you will go on to do http://api.stackexchange.com/2.2/users?page=1&order=desc&sort=reputation&site=pt.stackoverflow&key=sua_chave.

  • @mgibsonbr, you solved my problems, you are God. Thank you very much

2 answers

3

You need an API key to expand this number. In that reply you will see that with a key you can have up to 10,000 requests while the limit will continue to 300 if you do not have it. Sure, you can even get information from users without key, but it will have to be 300 per day.

To use it, just pass it in the query string. Type, if you are doing:

http://api.stackexchange.com/2.2/users?
page=1&order=desc&sort=reputation&site=p‌​t.stackoverflow

you will go on to do:

http://api.stackexchange.com/2.2/users?
page=1&order=desc&sort=reputation&site=p‌​t.stackoverflow
&key=sua_chave

(line breaks added by readability; obviously, there are no line breaks in Urls)

  • just out of curiosity: why did a community wiki reply? (ephemeral comment).

  • 2

    @Demarco Well, the problem was solved in the comments by 3 different users, but no one posted an answer. I summarized everything then, and posted here (to have a chance of it being accepted), but it doesn’t make sense for me to take all the credit, so the wiki.

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.