Skip to content

Instantly share code, notes, and snippets.

@srezasm
Created April 15, 2022 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srezasm/76688fc084e83d1681f843a7c72d5cfa to your computer and use it in GitHub Desktop.
Save srezasm/76688fc084e83d1681f843a7c72d5cfa to your computer and use it in GitHub Desktop.
How to get twitter list members with tweepy
import tweepy
auth = tweepy.OAuthHandler("CONSUMER_KEY", "CONSUMER_SECRET")
auth.set_access_token("ACCESS_TOKEN","ACCESS_TOKEN_SECRET")
api = tweepy.API(auth)
list_id = 1476313231572578313 # your list id
for user in tweepy.Cursor(api.list_members, list_id=list_id).items():
# hack 'm all
print(user.id_str)
print(user.name)
print(user.screen_name)
print(user.description)
print(user.url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment