Matt Stokes
Matt Stokes

Reputation: 4958

Twython get followers count

Is there an easy way to get the number of followers an account has without having to loop through cursors? I'm looking for a simple function call which will return to me just the number of followers the use with a given Twitter ID has.

Just looking for the physical number not access to anything else

Upvotes: 0

Views: 1046

Answers (2)

alko
alko

Reputation: 48357

You can use get users/lookup endopoint to query up to 100 of screen names or user ids, followers_count is included as well.

In twython it would be lookup_user api function.

Returns fully-hydrated user objects for up to 100 users per request, as specified by comma-separated values passed to the user_id and/or screen_name parameters.

Upvotes: 1

Matt Stokes
Matt Stokes

Reputation: 4958

What I ended up doing was .show_user(user_id=twitter_id) which returns (among other things) the followers count via ['followers_count']

Upvotes: 4

Related Questions