Reputation: 555
I scraped millions of tweets with the Twitter API V2 and in order to publish the data I wanted to replace all data with the tweet id, so that future users can reproduce my dataset. However I just realized that I did not save the "tweet_id" and I am now looking for ways to retrieve a tweet with different informations. I thought it would be possible to retrieve a tweet if you have the "author_id" and the exact timestamp.
Does anyone know a way how this is possible? Here is what I have at the moment:
import tweepy
client = tweepy.Client(bearer_token, wait_on_rate_limit=True)
u = client.get_user(id=1241497988423454720)
print(u)
print(u.data.username)
This gets me the username. However I don't know how to get a tweet at a specific time now. My dataset looks as follows:
Thanks in advance!
Upvotes: 0
Views: 470
Reputation: 56
If I understand your question correctly: It appears as though the twitter API supports fetching a user's (last 3200?) tweets by their user ID here, which you could possible use to fetch all tweets by a user. You could probably figure out the original ID of the tweet from there.
Upvotes: 0