Tweepy, Premium API, and Rate Limits - Hit 250 Requests in Less than 10 minutes, barely 10,000 tweets

Viewed 217

Using tweepy, I made the following request

tmpTweets = tweepy.Cursor( api.search_full_archive, label=LABEL_NAME, query=‘to:{}’.format(tweet_user), fromDate=tweet_date_formatted, toDate=tweet_date_end_formatted, maxResults=500).items()

The goal was to get all tweets to a user within a 72 hour period, so I can manually filter the "in_reply_*" features to find replies to a specific tweet.

Doing so, I paid for the 250-request limit API, as I had about 50 tweets I wanted to do this with.

Within ~5 minutes, I ran out of my query limit, claiming I did 253 queries. At this point, I had only processed about 3 tweets.

So, my guess is that a single "call" in my code isn't a request, but rather every 500-tweets returned is a request. Thus that single line of code can be multiple requests. Can anyone confirm?

Secondly, I wonder how this makes sense. The Full Archive Premium API offers

250 Requests
1.25M Tweets

However, if a single request can return only 500 tweets, then the max tweets you can ever obtain is (250*500=125,000) Tweets. Thus, I fundamentally believe I am structuring my requests wrong to obtain proper usage of my Premium account.

So my question is...

tmpTweets = tweepy.Cursor( api.search_full_archive, label=LABEL_NAME, query=‘to:{}’.format(tweet_user), fromDate=tweet_date_formatted, toDate=tweet_date_end_formatted, maxResults=500).items()

How do I alter this line of code to be able to maximize the number of tweets I get, such that I am not blowing through my request limit ( 253/250 ) well before my tweet limit ( 123K/1.25M )

Thanks!

0 Answers
Related