-1

No one seems to be able to answer my question and I can not find it in the other posts. Using twitter's api, I want to enter in a tweet id and return an array of all the users who retweeted that tweet.

example:

input -> retweeters(tweet_id)

output -> ['username1','username2','username3','username4']

This can be done with this link

I do not need the tweet or the retweet, I need the usernames of the people who retweeted a particular tweet so therefore retweets_of_me would not be helpful here. If you help me out, I'd be very grateful. Thank you

5
  • it looks like the api call returns the user ids: Returns a collection of up to 100 user IDs belonging to users who have retweeted the tweet specified by the id parameter.
    – dm03514
    Commented Jun 18, 2013 at 15:07
  • @dm03514 yes. I need to know how to implement that into python. Commented Jun 18, 2013 at 15:09
  • -1 because it's repeated with the question: stackoverflow.com/questions/17169832/… of the same user Commented Jun 18, 2013 at 15:15
  • @siluaty it is repeated because the solution was incorrect, but ok Commented Jun 18, 2013 at 15:19
  • @user1681664 You should add a comment saying that the solution doesn't work (as you have already done), and then wait for other solutions, instead of creating a new question! Commented Jun 18, 2013 at 15:22

2 Answers 2

0

GET statuses/mentions can be used. That API call returns any mentions of a user, and you can pass the flag include_rts. This will include any retweets of your tweets. If you wanted to list RTs of a specific tweet, you could check the in_reply_to_status_id field in the returned data to see if it matches the original tweet ID.

However even this has a limit (I expect quite higher though) So you will have to do it in a repetitive polling fashion

1
  • that does not return an array of user_ids Commented Jun 18, 2013 at 15:28
0

You can use twython, which allows you to access the Twitter API and collect the list of retweeter IDs with the following code:

from twython import Twython

twitter = Twython(APP_KEY, APP_SECRET,OAUTH_TOKEN, OAUTH_TOKEN_SECRET)

search = twitter.get_retweeters_ids(id=327473909412814850)

for result in search["ids"]:
    print result

The get_retweeters_ids() function takes the same arguments as the Twitter API call, which is the id of the Tweet you want to track. The result is a JSON object that contains the retweeter IDs in the field "ids".

I hope this helps.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.