import tweepy consumer_key = "" consumer_secret = "" access_token = "" access_token_secret = "" auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) for status in api.user_timeline("xxxxx", count=3)[::-1]: if not status.retweeted: api.retweet(status.id)