skip to Main Content

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


  1. You should be able to use tweepy.AppAuthHandler in the same way that you’re using OauthHandler.

    auth = tweepy.AppAuthHandler(token, secret)
    api = tweepy.API(auth)
    

    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.

    Login or Signup to reply.
  2. 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 field count to 200 which is the maximum value, while the default is only 20. That will save you some requests.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search