Data Collection

Why cannot you access tweets older than a week in tweepy?

Hi! You are wondering why your code is not working, when you try to download old tweets…

Photo by Karim MANJRA on Unsplash

Indeed, the problem is not in your code, but in the Twitter API, which permits to access only to the tweets of the last week. The official Twitter documentation says:

The recent search endpoint allows you to programmatically access filtered public Tweets posted over the last week, and is available via the Standard and Academic Research product tracks.

In order to build a complete dataset, you could run your code daily and then hope that in the future it will be so big for your analysis.

Another solution to your problem could be to search in the Internet for some available datasets, such as those available here (which I have not tested personally). In addition, you could read this thread for some inspiration.

This post is a response to a comment posted on the following article:

Thank you Kian Tiari for your comment :)

Top 1000 Medium Writer in May, June and July 2021. I write on Data Science, Python, Tutorials and, occasionally, Web Applications.

Top 1000 Medium Writer in May, June and July 2021. I write on Data Science, Python, Tutorials and, occasionally, Web Applications.