Hi,
I am creating an app that uses the API to scan tweets from hashtag search and then scans the timeline of the users that tweeted that specific hashtag.
The problem is that when using only my developers token I reach rate limits very quickly.

Scan Example:

  • searching for #somehashtag
  • query returns for instance 1000 tweets
  • user timeline request for every unique user returned from the hashtag query

My in house app will be used by other users but not necessarily ones that have twitter accounts so i can’t rely on connecting them to the app.
Is there a way I can generate more tokens or get a better rate limit in some API requests?
I am willing to pay a monthly fee in order to achieve this.
Thanks

other users but not necessarily ones that have twitter accounts

Once you implement https://developer.twitter.com/en/docs/twitter-for-websites/log-in-with-twitter/guides/implementing-sign-in-with-twitter you can try pooling all your available tokens, together with app only authentication and share that between all users - usually there are only a few active users that need lots of calls, so it can be unevenly distributed.

Overall though, sounds like you want https://developer.twitter.com/en/docs/tweets/search/overview/premium premium search. It works in a different way and does not use user tokens, it’s app only. Also, in premium you can have much larger queries, so you could request timelines for many users at once, saving on calls.

1 Like

thanks for the response
do you know if there is a way to increase the GET following\followers rate limit?

No, but you should use both https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-followers-list that returns 200 users per call for accounts that have a few followers (you can check the counts in a user object before making the call) and for users with larger numbers of followers https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids that get 5000 user ids (you can get full user objects for those with users/lookup).

And same for friends endpoints, making sure to set count=200 or count=5000 to get the most data from each call, by default they only return 20 per page? but not sure about that number, always worth explicitly setting parameters.

Across those 4 endpoints, and with app auth and user auth for each, and some checks and stopping conditions (eg: only retrieve 5000 followers for accounts with >20k or something, using just 1 call per user) you should be able to get it to work.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.