0
votes

I want to pull tweets from an authenticated user's home timeline (user + people the user follows) of past 7 days. How can I do this? The documentation of GET statuses/home_timeline only provides a count parameter and some other parameters like since_id and max_id which I don't really understand.

Documentation: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-home_timeline

Is there any other endpoint which might help? Or is it just impossible to do so?

1
It’s completely possible. You need to page through the home timeline endpoint results, per the documentation.Andy Piper

1 Answers

1
votes

The recent search in the Twitter v2 API can do what you are asking.

Here is an example:

https://api.twitter.com/2/tweets/search/recent?query=from:username is:verified&max_results=100

The Research Search API can only search in the last 7 days by default. You can return a maximum of 100 tweets per request.

Docs: https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-rule