1
votes

I am using Twitter API statuses/user_timeline method to collect users tweets. Documentation says that it is possible to get up to 3200 most recent tweets (https://dev.twitter.com/rest/reference/get/statuses/user_timeline), but when I try to gather tweets I need to set count, because without count it returns only 15 latest tweets. As documntation says the maximum value of count is 200. So, the question is how to return more than theese 200 tweets of user?

My query looks like this

    https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=some_random_name&count=200 

and I am using twitterOauth library.

1

1 Answers

0
votes

The documentation you are missing is here. Basically, you make your first request, which returns up to 200 tweets. Then, using the id of the last (oldest) tweet you make another request, but this time you set the max_id parameter to this id, which returns the next set of tweets. Repeat the process until you get all 3200 tweets or until no tweets are returned.