Reputation: 1206
When I search tweets using Tweepy, I only get the latest tweets.
public_tweets = twitter.search_tweets('text to search', count=10, tweet_mode='extended')
I was wondering is there any way to get top tweets (first tab on mobile app) using its api?
Upvotes: 1
Views: 472
Reputation: 1843
You can set the result_type
argument to 'popular'
to get only the top tweets.
public_tweets = twitter.search_tweets('text to search', count=10, result_type='popular', tweet_mode='extended')
It is mixed between the top tweets and the more recent tweets by default.
For more information and to see the other possible values, you can read the documentation here.
Upvotes: 3