"Rate Limit Exceeded" for getting follower list.

850 views
Skip to first unread message

Jesse A

unread,
Aug 8, 2013, 9:12:23 AM8/8/13
to tumbl...@googlegroups.com
I've been testing out a new little thing I'm developing for a group of friends.

It fetches the "Likes" and "Reblogs" of a post, and selects winners from that list.

The user can select to "Only Include my Followers" to limit the "wins" to people who follow them.

As I've been testing it, I've had no problem until just now, getting a "Rate Limit Exceeded" error.

I waited about five minutes and tried again, and it worked just fine, but it made me question, might others with larger followings get the error any time they try it out?

Here's the deal.  It fetches one group of 20 Followers (since I can't seem to grab more than 20--don't know why the limit is set so low).  It waits for my entire page to load (about a second), and then JavaScript resubmits a new form, with PHP fetching the next set of followers.

With someone that has a less-than-300-followers base like me, it only takes 15 seconds or so.  With someone with a 7000-follower base, though, it would take 5 or 6 minutes.  That's still cool by me, though I was originally planning on having it fetch a loop of 5 groups of 20 per page load instead of 1 group.

But... with so many requests, will it hit the Rate Limit?  What can I do to avoid that?  Am I being somehow dumb by not being able to grap all the followers in a single request?  (I've tried setting the limit to several hundred, but no dice.)  What's the "right" way to get a list of followers for a blog?

Jesse A

unread,
Aug 8, 2013, 10:58:14 AM8/8/13
to tumbl...@googlegroups.com
As an addendum, two things:

First of all, a user with 7000+ followers tested out my application and received the "Rate Limit Exceeded" error after fetching 400 users (about 20 requests, probably in about 20 seconds).  Please tell me I'm just fetching the follower list the wrong way. XD

Secondly, the documentation states:

offset -- 
Number  -- Result to start at -- 
0 (first follower)  -- No

0 is NOT the first follower, it is the LAST follower.  No biggie, but figured you might want to change this.



I do await a favorable response telling me, "no, dummy, you can get the Followers of a blog much easier and quicker this way."  :P  Otherwise, well, getting followers for larger blogs is pretty much useless.  By the time you get all of their followers, they're bound to have 10 more.  Oh Tumblr Gods, educate this poor fool, please.

Jesse A

unread,
Aug 9, 2013, 1:05:01 AM8/9/13
to tumbl...@googlegroups.com
I feel retarded but happy.  I've found the solution.

For those of you that happen to stumble across this while facing a similar problem, here's some information.

There are three Headers that help out a lot with this:

x_ratelimit_api_followers_limit
x_ratelimit_api_followers_remaining
x_ratelimit_api_followers_reset

(Well, the actual headers are different, but this is what my PHP app converts them to--you'll notice them when you see 'em, heh.)

The "Limit" seems to be "How Many Calls I can make in X amount of time."  (In this case, one minute.)

The "Remaining" is "How many Calls I have LEFT for this period of time."

The "Reset" is "When will 'Remaining' equal 'Reset' again?" (and is a timestamp value).



For me, that means I can make 60 Requests per minute to the API.  It also let me know that I was making one or two ADDITIONAL calls per page, and that's why it was "exceeding Rate Limit" after only about what I thought was 20 requests.

With this information, you can use timeouts, sleeps, or whatever construct that pauses execution in the language you're using to stagger your calls to the API, and it's NOT as horrendously slow as I thought it would be.

(Major thanks to Rusty, who seemed to have a problem with Ratelimits--I looked over in his thread there to see what I was missing.)




Still might wanna fix that documantation about First Follower being 0, though.
Reply all
Reply to author
Forward
0 new messages