geduldig / TwitterAPI

Minimal python wrapper for Twitter's REST and Streaming APIs
936 stars 263 forks source link

[Question] Handling of too many requests #186

Closed santoshbs closed 3 years ago

santoshbs commented 3 years ago

I was wondering if this package handles errors arising from too many requests made to a Twitter API made in a given time slot.

geduldig commented 3 years ago

If you are using the TwitterAPI.request method, you should catch the appropriate error and throttle your requests. If your are using the TwitterPager helper class, it will automatically throttle for you. The class also takes an optional wait argument to set the interval between requests.

The docs are sorely out-of-date. I'll be working on this in the next couple of weeks. Exceptions to be caught are listed here.