I have the following code in Python:
import tweepy
consumer_key = "..."
consumer_secret = "..."
access_token = "..."
access_token_secret = "..."
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
start_date = datetime.datetime(2018, 1, 19, 12, 00, 00)
end_date = datetime.datetime(2018, 1, 19, 13, 00, 00)
api = tweepy.API(auth)
for tweet in tweepy.Cursor(api.user_timeline, screen_name="@IBM", since=start_date, until=end_date).items():
print("ID TWEET: " + str(tweet.id))
Is there a way to get tweets between start_date
and end_date
, by modifying the cursor with tweepy?
I have already tried to use the since=
and until=
parameters, but they have not worked.
Thank you in advance.
until
has a time limit:(...) the search index has a 7-day limit. In other words, no tweets will be found for a date older than one week.
developer.twitter.com/en/docs/tweets/search/api-reference/… – Alcantarahttps://stackoverflow.com/questions/26205102/making-very-specific-time-requests-to-the-second-on-twitter-api-using-python
or this onehttps://gist.github.com/alexdeloy/fdb36ad251f70855d5d6
– Oxygenate