Avoid Twitter API limitation with Tweepy

前端 未结 5 1421
时光说笑
时光说笑 2020-11-30 21:18

I saw in some question on Stack Exchange that the limitation can be a function of the number of requests per 15 minutes and depends also on the complexity of the algorithm,

5条回答
  •  醉梦人生
    2020-11-30 22:19

    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.

提交回复
热议问题