I am trying to pull all the tweets from USATODAY's twitter account. But, I keep hitting the rate limits when doing so. How do I start from where I left off of after I hit the rate limit?
For example, there are a total of 100k tweets. My code gets the first 3000 then hits the limit. How do I start at 3001 when my limit resets and so on until I can get all 100k?
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token_key, access_token_secret)
api = tweepy.API(auth)
for tweet in tweepy.Cursor(api.user_timeline,id='USATODAY').items():
print(tweet)
Outside of API limits, only the most recent 3000 tweets are available to anyone other than the account holder, even in the web interface. If you want the tweets before that, you'd need access to the archive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With