I want to collect all tweets in English using tweepy. Twitter search API can be used here, but I don’t know what to give in ‘query’ part of api. From documentation I understand that this part is required.
How to handle this query part and collect all English tweets?
2
Answers
I am not sure how you can do this with Tweepy but if you can directly invoke a Twitter endpoint you just have to add the
lang
parameter as followed :https://api.twitter.com/1.1/search/tweets.json?q=your_search&lang=en
If you want to gather all Tweets in English – that’s impossible without access to Twitter’s GNIP platform.
What you can do, is use the streaming API to get a sample of all English Tweets.