In this article we will see how we can get the number of times a tweet/status has been retweeted. The retweet_count attribute of the Status object provides us with the number of times a tweet has been retweeted .
Identifying the number of times a tweet has been retweeted in the GUI :

The above mentioned status has been retweeted 4 times.
In order to get the number of times a status has been retweeted, we have to do the following :
- Identify the status ID of the status from the GUI.
- Get the Status object of the status using the
get_status()
method with the status ID.
- From this object, fetch the retweet_count attribute present in it.
Example 1 : Consider the following status :

We will use the status ID to fetch the status. The status ID of the above mentioned status is 1272771459249844224.
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)
id = 1272771459249844224
status = api.get_status( id )
retweet_count = status.retweet_count
print ( "The number of time the status has been retweeted is : " + str (retweet_count))
|
Output :
The number of time the status has been retweeted is : 0
Example 2 : Consider the following status :

We will use the status ID to fetch the status. The status ID of the above mentioned status is 1272479136133627905.
id = 1272479136133627905
status = api.get_status( id , tweet_mode = "extended" )
retweet_count = status.retweet_count
print ( "The number of time the status has been retweeted is : " + str (retweet_count))
|
Output :
The number of time the status has been retweeted is : 22
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
18 Jun, 2020
Like Article
Save Article
Vote for difficulty