Morningstar88 / mykra-android

Promoting trash collection, mealsharing, local innovators and shops that donate clothes to the homeless.
GNU General Public License v3.0
0 stars 2 forks source link

Reddit API Rate Limit documentation. #35

Closed Morningstar88 closed 6 years ago

Morningstar88 commented 6 years ago

Useful Quotes from Rate Limit Documentation

Thread: Reddit API Rate Limit Question

https://www.reddit.com/r/webdev/comments/1z8tqk/reddit_api_rate_limit_question/

Thread: Ratelimit?

https://www.reddit.com/r/redditdev/comments/5wjbkz/ratelimit/

I am confused about reddit OAuth requests limit.

The wiki page states that it is "60 requests per minute"

But X-Ratelimit-Remaining shows 600.

And a lot of people here on r/redditdev claim that limit is 1 request per second.

What to believe?

Is it allowed to hit reddit two times in a row?

"/api/v1/me/prefs?fields=over_18" "/r/subreddit/"

Or should I wait for one second after the first?

*

The rate limiting allows for some level of burstiness - e.g. you could do 10 requests in a second, then wait three minutes, then do 5 requests, then wait 15 seconds, etc.

So there are three fields to look at: X-Ratelimit-Used, X-Ratelimit-Remaining and X-Ratelimit-Reset. The last one is the number of seconds until your next rate limiting period. Feel free to burst ahead of a strict 1 req/sec rate, so long as your Remaining number is above 0 - just be warned that if you get to 0, you'll have to wait for the Reset before making more requests.

More info here: https://github.com/reddit/reddit/wiki/API#rules

*