Is it possible to get more than 200 tweets with getUserTimeline

twitter4j

#1

Im developing in java and using the twitter4j library

And my code is

Paging paging = new Paging(1,250);
ResponseList statuses=twitter.getUserTimeline(user,paging);

but it wont give me more than 200 tweets.

I alse tried:

Paging paging = new Paging(200,400);
ResponseList statuses=twitter.getUserTimeline(user,paging);

but it returns empty.

Is it possible? is there an alternative?


#2

No you can’t get more than 200 tweets. I’m not familiar with the code or wrapper you’re using but I believe you’re using the endpoint “statuses/user_timeline” which has a parameter max_id. You can parse 200 tweets and then next time you call the API you set max_id to the last Twitter ID you retrieved which will do the same as 200, 200.