Making a network graph of 500+ Twitter users who are using the common hashtags



Hi all,

For my research paper, I am looking into specific hashtags. In those hashtags I collected 500+ users. Now I want to look at if those users are connected to each other on any degree at all or they just happen to share the same hashtag. ( I am not interested in who they are connected in general. I only want to see the graph in this 500 people, they may very well not be connected at all so it would mean 500+ circles which is perfectly fine)

For this I was using “lookup_friendships”. However two problems I am facing, It only lets me to see the relationship between my account and others. Even though I solve this problem, I still do not know how to create edges with this data. I have seen few people wanted to do something similar and they asked similar questions but it seems like they could not get help.

Note: I am a social scientist so Python knowledge is limited.

Thank you so much!


For two arbitrary users, you should use GET users/show.

Check out twurl for a simple test tool, or the twitter gem or tweepy.


Thank you!

relationships = api.show_friendship(source_screen_name= a, target_screen_name= b) did it for me.


@happycamper as a follow up question,

I keep getting the “TweepError: Failed to send request: (‘Connection aborted.’, OSError(”(60, ‘ETIMEDOUT’)",)) "

I tired to create exception but did not work. If you have any suggestions, it would be awesome! Thank you!


Do you have more detailed logs related to this error?


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.