We’re building a simple script using the Tweepy Python library. We need to get some simple information on all of the accounts following our Twitter account.
Using the cursor Tweepy’s built in this is quite easy, but we very rapidly hit the 15 request limit for the window. I’ve read that per-App (as opposed to per-user) authentication allows for 300 requests per minute, but I can’t find anything in the Tweepy API that supports this.
Any pointers?
2
Answers
You should be able to use
tweepy.AppAuthHandler
in the same way that you’re usingOauthHandler
.For some reason, this isn’t documented, but you can take a look at the code yourself on GitHub.
It also depends what kinds of requests you’re making. There are no resources with a 15 request user limit that have a 300 request app limit. You can consult this chart to determine the limits for user and app auth for each endpoint. In any case, using them in conjunction will at least double your requests.
I’m not what information of your followers you are after exactly, but it might be part of the request
followers/list
. If so, you can set the fieldcount
to200
which is the maximum value, while the default is only20
. That will save you some requests.