Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API call limit #1

Open
tczee36 opened this issue Mar 11, 2019 · 1 comment
Open

API call limit #1

tczee36 opened this issue Mar 11, 2019 · 1 comment

Comments

@tczee36
Copy link

tczee36 commented Mar 11, 2019

How to avoid the following error?

Traceback (most recent call last):
File "tweet.py", line 30, in
for tweet in tweets:
File "/usr/local/lib/python3.7/dist-packages/tweepy/cursor.py", line 49, in next
return self.next()
File "/usr/local/lib/python3.7/dist-packages/tweepy/cursor.py", line 197, in next
self.current_page = self.page_iterator.next()
File "/usr/local/lib/python3.7/dist-packages/tweepy/cursor.py", line 108, in next
data = self.method(max_id=self.max_id, parser=RawParser(), *self.args, **self.kargs)
File "/usr/local/lib/python3.7/dist-packages/tweepy/binder.py", line 250, in _call
return method.execute()
File "/usr/local/lib/python3.7/dist-packages/tweepy/binder.py", line 234, in execute
raise TweepError(error_msg, resp, api_code=api_error_code)
tweepy.error.TweepError: Twitter error response: status code = 429

thanks

@rohanvivek
Copy link

Add wait_on_rate_limit=True on the API call like this:

api = tweepy.API(auth, wait_on_rate_limit=True)
This will make the rest of the code obey the rate limit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants