Tweepy API Search Results and Rate Limits

I am new to Python and Tweepy and I have a little chat with it. I found this piece of code using gumption. I used it to populate an excel file with tweets, which works well.

But I have a couple of questions: How many tweets can I use in this loop? Or, to be more specific, when I get the first 2000 in the last few days, are all those tweets sent for the tag I was looking for? Or is it the same as with the Streaming API that I can get 1% of all tweets?

And I don't really understand my speed limits. How many requests does it take to get 10.000 tweets using the above code? That's 100 tweets per page, so 100 pages = 100 requests are required?

+3


source to share


1 answer


When I get the first 2000 in the last days, all those tweets you sent for the tag I was looking for? Or is it the same as with the Stream API that I can get 1% of all tweets?

Neither. Twitter makes tweets available up to two weeks in the past. However, for all keywords, they are not the same:

The search API is not a complete index of all tweets, but instead an index of the most recent tweets. This index currently includes 6-9 days of tweets.

In addition, it is not guaranteed that all recent tweets are indexed by the Twitter Search API:



It's important to know that the search API is focused on relevance, not completeness. This means that some tweets and users may not appear in search results.

This information is taken from the Twitter Search API General Information page , which is easy to read and will answer a lot of questions.

And I don't really understand my speed limits. How many requests does it take to get 10.000 tweets using the above code?

The Twitter API has a graph explaining the rate limits for different resources. Speed ​​limits come in 15 minute chunks. For a search, you have 180 queries in a 15 minute window. Since you can get 100-count per request , in theory you can collect 180 * 100 = 18k tweets in 15 minutes. However, you can collect as many tweets as Twitter provides you with (see Inclusion 6-9 days). The number of tweets you can receive depends on your keywords and what Twitter provides.

+5


source







All Articles