I am currently developing a Discord bot that notifies a user of their new followers/lost followers once a day. My app does have elevated API access, yet the rate limit for getting followers is still only 15 per 15 minute window. This makes it almost impossible to get a users followers if they have more than 15,000 (as I can only get a max of 1000 every request), and even more difficult to configure it to track multiple user’s followers.
My following questions are:
Why does this rate not increase with elevated access (or even Academic Research)?
Will the rate limit be increased in the future?
If not the near future, is it possible to for me increase the rate limit/max result limit?
Thanks!
If it’s an account you own or have access to, you should try the account activity API, that way you will get events for follows. There’s no events for unfollows so you’ll have to process those separately as before. Overview | Docs | Twitter Developer Platform
When tracking new followers with the rest API, new followers will also appear first, so you only need to make 1 request for the latest ones, and there’s no need to paginate.
This way, combining both, you will be getting new followers incrementally with account activity API or the rest API, and unfollowers after enumerating all followers periodically.
Thank you for your suggestions Igor.
Unfortunately, because this is a public discord bot, the majority of users will be tracking their own accounts, not ones I own/have access to, so I would be unable to use the account activity API.
Periodic scanning would remove the need to paginate through requests for smaller accounts, but for larger accounts that get over 1,000 followers between the set periods, my bot would become unusable. Of course this is unlikely for most accounts, but as a programmer I prefer to imagine all use cases and provide support towards them all.
Also, periodic scanning would remove the lost followers use case. If a user loses a follower and has more than 1,000 followers, without getting all followers and comparing that to the last scan, I wouldn’t be able to alert that user.
All that said, your suggestions do help for the stage my bot is at now. But in the future I would like this bot to be able to support users with a larger following, and this might not support them.
1 Like
Yeah, for tracking extremely large accounts it’s more difficult. You can cache the responses and make more calls as necessary if there’s a bigger difference in the counts - the user object public_metrics will give you follower numbers you can use to check if it’s worth using 1 or more calls to check for differences. There may be edge cases where there is extremely high churn, so you could have a stopping condition where it keeps paginating until there are no differences detected.