Search code examples
pythonapitwittertweepytwitter-streaming-api

how to list all users who tweeted a given keyword using twitter api and tweepy


How to list name of users who tweeted with given keyword along with count of tweets from them ? I am using python and tweepy.

I used tweepy to list JSON result in a file by filter(track["keyword"]) but doesn't know how to list users who tweeted given keyword.


Solution

  • Once your data has been loaded into JSON format, you can access the username by calling tweet['user']['screen_name']. Where tweet is whatever varibale you have assigned that holds the JSON object for that specific tweet.