The best way to get a list of followers in Python with Tweepy

user2547755 picture user2547755 · Jul 3, 2013 · Viewed 16.1k times · Source

Is there a better way to get a list of followers screen names with Tweepy than this:

for follower in api.followers_ids('twitter'):
    print api.get_user(follower).screen_name

Answer

alecxe picture alecxe · Jul 5, 2013

I think this is more efficient:

for user in tweepy.Cursor(api.followers, screen_name="twitter").items():
    print user.screen_name

FYI, it uses followers/list twitter API call.