I would like to find public users on Twitter that have 0 followers. I was thinking of using https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-search, but this doesn’t have a way to filter by number of followers. Are there any simple alternatives? (Otherwise, I might have to resort to using a graph/search based approach starting from a random point)
Question posted in Twitter API
The official Twitter API documentation can be found here.
The official Twitter API documentation can be found here.
2
Answers
Bird SQL by Perplexity AI allows you to do this simply: https://www.perplexity.ai/sql
Query:
Users with 0 followers, and 0 following, with at least 5 tweets
Well you didn’t specify what library you are using to interact with the Twitter API. But regardless of which technology you’re using, the underlying concept is the same. I will use tweepy library in python for my example.
Start by getting the public users using this. The return type is a list of user objects. The user object has several attributes which you can learn about here. For now we are interested in the followers_count attribute. Simply loop through the objects returned and check where the value of this attribute is 0.
Here’s how the implementation would look like in python using tweepy library;