Avoid Twitter API limitation with Tweepy

For anyone who stumbles upon this on Google, tweepy 3.2+ has additional parameters for the tweepy.api class, in particular:

  • wait_on_rate_limit – Whether or not to automatically wait for rate limits to replenish
  • wait_on_rate_limit_notify – Whether or not to print a notification when Tweepy is waiting for rate limits to replenish

Setting these flags to True will delegate the waiting to the API instance, which is good enough for most simple use cases.

Leave a Comment