I have found this question. However I think this has changed on API version 1.1.
If I use the search/tweets
method, how can I see if the tweet is a RT?
I see that the retweeted
field always returns false
. Is there another field I can use for this answer?
As everyone else has mentioned, you can check to see if the
retweeted_status
property exists in the response subfield for that Tweet.However, per the current version of the API, every Tweet object has the field
retweeted
that stores a boolean value (True or False) that will tell you if a Tweet has been retweeted.By simply checking the property name
"retweeted_status"
if you does not find then it's not RT.
The retweeted field is false if the retweet is not done using the retweet button but rahter via RT, so in such a case, just search the "text" field of all tweets for this pattern
RT @
This pattern can be of help, but I don't think there is any other function for this.
As @Joe Mayo said, check for the
retweeted_status
key on the status object.I have an example that is not caught by @Apoorv Ashutosh's suggestion.
See: https://twitter.com/gppvt/status/474162466776449024 this will redirect (because it is a retweet) to the original tweet. However if you get this tweet through the twitter API, it has
retweeted_status
. Notice the text does not contain "RT".If it's a retweet, the tweet will contain a property named
retweeted_status
. To be complete,retweeted_status
will not appear if the tweet is not a retweet. More info at: Tweets.Just to add a bit more. (using twitter gem (ruby language))
You can check if its a retweet by checking the tweet and then getting what you need from the retweeted_status hash