tweepy.error.TweepError: Twitter error response: status code = 401
See original GitHub issueTraceback (most recent call last):
File "twitter_media_downloader.py", line 36, in <module>
medias = get_medias(auth, user_id, args.retweets, args.image_size, args.since, args.since_id, args.until, args.until_id, args.likes)
File "/root/twitter_media_downloader-master/src/parser.py", line 94, in get_medias
for tweet in tweepy.Cursor(capi, id=user_id, include_rts=include_retweets, include_entities=True, tweet_mode='extended', since_id=since_id, max_id=until_id).items():
File "/usr/local/lib/python2.7/dist-packages/tweepy/cursor.py", line 243, in next
self.current_page = self.page_iterator.next()
File "/usr/local/lib/python2.7/dist-packages/tweepy/cursor.py", line 132, in next
data = self.method(max_id=self.max_id, parser=RawParser(), *self.args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/tweepy/binder.py", line 253, in _call
return method.execute()
File "/usr/local/lib/python2.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 = 401
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Twitter API Response Codes & Error Support - Twitter Developer
Different error codes indicate different reasons for an error. The Twitter API attempts to return appropriate HTTP status codes for every request.
Read more >tweepy and error 401 : r/Python - Reddit
TweepError : Twitter error response: status code = 401 ... I haven't personally used tweepy however if your problem still persists I will...
Read more >Approval - Twitter API v2 - Twitter Developers
... though when I tried to use tweepy on python to get tweets, I got the error message “TweepError: Twitter error response: status...
Read more >Frequently Asked Questions — tweepy 4.12.1 documentation
Why am I encountering a 401 Unauthorized error with API or 403 Forbidden error ... See Twitter's API documentation on app permissions for...
Read more >tweepy.error.TweepError: HTTP Error 401: Unauthorized
'http://twitter.com/oauth/authorize? oauth_token=1Vlq6hb3Hgs0WqgzP0UIdSIXp1bpZXl9PTgryNrI' >>> auth.get_access_token('8643199') <tweepy.oauth.OAuthToken object ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Check your key and secret key. The README was a little bit confusing. I ended up with 401 too when I tried it first.
Basically, use API token and API secret key instead of the Access token and secret key.
Indeed, It would seem that a proper access token is required to access protected accounts. Thanks @kittinan. I just pushed a fix for that, sorry for the delay 👍
An invalid key can also cause this issue on public accounts, so I renamed the “consumer token” to “consumer key” to prevent confusion (also because that’s the official name now).