List of retweets for a given user?

restapi
android
fabric
rest
api

#1

I was looking through the documentation for the REST api and I couldn’t seem to find a way to get retweets for a user similar to this: https://dev.twitter.com/rest/reference/get/favorites/list

is there anyway to perform a similar function to get a list of retweets for a given user? Thanks for any help.


#2

Not sure if you want Retweets of any tweet created by a given user, or any tweets created by the user that are retweets… in any case:

If you want to get Retweets of any Tweet created by the user, you’ll need the Streaming API with follow parameter: https://dev.twitter.com/streaming/overview/request-parameters#follow

If you want to get tweets a given user has retweeted, you can use https://dev.twitter.com/rest/reference/get/statuses/user_timeline and remove any tweets created by the user.


#3

Basically, a list of tweets that a given user retweets. So for example for https://twitter.com/twitterapi, the list would comprise of

  1. https://twitter.com/TwitterDev/status/791424729580122114

  2. https://twitter.com/TwitterDev/status/777916106405212160

  3. https://twitter.com/TwitterDev/status/776096353587982336

and so on. Basically, if a user retweets a given tweet, that tweet is added to that list. I think what I would have to do is use https://dev.twitter.com/rest/reference/get/statuses/user_timeline and I played around with it in the console and retweets start with “retweeted_status” so i’d store the contents of “retweeted_status” each time it occurs for a request. Is that the best way of going about what I’m trying to do? Thanks.


#4

Yep: /user_timeline endpoint, and checking for retweeted_status will get you the tweets you want.

Also check out https://dev.twitter.com/rest/public/timelines for more on working with /user_timeline - you can get the most recent 3200 tweets for a user - but that includes any kind of tweet (tweet, retweet, reply)