User ID to Username tweepy
问题 Can someone please tell me how to get one username from one id on tweepy? I have looked everywhere and can't find anything. 回答1: If you just have a user_id value you need to call the twitter API with the get_user(user_id) method. The returned User object will contain the username under screen_name. # steps not shown where you set up api u = api.get_user(783214) print u.screen_name If you already have the User object from another API call just look for the screen_name. 回答2: You can use this