Using the twitter API and Python to obatain retweeter's id
Question: I have an issue that has been bothering for a while now, and which I have
tried really hard to fix but have found no solution. So I'm doing an
internship doing research on complex networks, nothing business-oriented, it's
mostly physics and network theory research that they are doing. So what I'm
doing is writing scripts for them to obtain data from twitter and tumblr (such
as friend lists, and retweets) and then then graphing the user-to-user
relations.

Anyways, going straight to my problem, I have already written my script pretty
much, mainly using the twitter-python wrapper. However, none of the wrappers
for python has any way of using the GET statuses/retweets/:id which returns
the 100 first retweeter's ids. I've looked through all different twitter
libraries for python and could not find anything. I found tweety for MATLAB
but I'm using Ubuntu and it hasn't been easy to obtain.

So my question is, how can I implement this API myself, without a wrapper? is
there any wrapper, even in another language that you guys would know allows me
to do this? I wouldn't mind getting the retweet information in a file and then
using my python script to go over it and get the information I need.

Thank you very much! This is the resource I wanna use:
<https://dev.twitter.com/docs/api/1.1/get/statuses/retweets/%3Aid>

EDIT: So with tweepy this is what I'm trying to do

    
    
    auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
    auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
    
    tweet = auth.retweets(TWEET_ID)
    
    print json.dumps(tweet, indent=1)
    


Answer: Looks like [tweepy](http://pythonhosted.org/tweepy/html/index.html) should
work for you. See
[docs](http://pythonhosted.org/tweepy/html/api.html?highlight=retweet#API.retweets)
and [source](https://github.com/tweepy/tweepy/blob/master/tweepy/api.py#L124).

Example:

    
    
    import tweepy
    
    auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
    auth.set_access_token(key, secret)
    
    api = tweepy.API(auth)
    
    public_tweets = api.search("stackoverflow")
    for tweet in public_tweets:
        print api.retweets(tweet.id)
    

Hope that helps.

