0
votes

Here is what i'm trying to do :

I have a list a twitter user ID, for each one of them I need to retrieve a complete list of his followers ID and his friends ID. I don't need anything else, no screen name etc..

i'm using twitter4j btw

Here is how I'm doing it :

for each user i'm executing the following code in order to get a complete list of his followers IDs

long lCursor = -1
do{
    IDs response = t.getFollowersIDs(id, lCursor);
    long tab[] = response.getIDs();
    for(long val : tab){
        myIdList.add(val);
    }
    lCursor = response.getNextCursor(); 
}while(lCursor != 0);

My problem :

according to this page : https://dev.twitter.com/docs/api/1.1/get/followers/ids

the request rate limit for getFollowersIDs() is 15, considering this method return a maximum number of 5000 IDs, it means that it will be only possible to get 15*5000 IDs (or 15 users if they have less than 5000 followers).

This is really not enough for what i'm trying to do.

Am I doing something wrong ? Is there any solutions to improve that ? (even slightly)

Thanks for your help :)

1
I honestly thought that this had changed to a straight forward 150/hr api call limit. https://dev.twitter.com/docs/rate-limitingJohn Drefahl

1 Answers

3
votes

The rate limit for that endpoint in v1.1 is 15 calls per 15 minutes per access token. See https://dev.twitter.com/docs/rate-limiting/1.1 for more information about the limits.

With that in mind, if you have an access token for each of your users, you should be able to fetch up to 75,000 (15*5000) follower IDs every 15 minutes for each access token.

If you only have one access token you'll, unfortunately, be limited in the manner you described and will just have to handle when your application hits the rate limit and continue processing once the 15 minutes is up.