I am having this error here.
Error content:
TwythonError: Twitter API returned a 403 (Forbidden), You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here:
What I’ve done:
- Verified the access level of the Twitter API, confirming it’s LIMITED V1.1 ACCESS ONLY, V2 ACCESS.
- Subscribed to the Basic plan.
I’ve also confirmed the access level of the Twitter API and subscribed to the Basic plan, which should allow for searching as well. There doesn’t seem to be a reason for the error to occur, but I’m still stumbling and finding it difficult.
Environment in use:
- Python 3.11
- Twitter API plan: basic
- Anaconda
- Twython
- (using Twython on Anaconda)
- M1 Mac mini
from twython import Twython
APP_KEY = ‘my_key’
APP_SECRET = 'my_key'
twitter = Twython(APP_KEY, APP_SECRET, oauth_version=2)
ACCESS_TOKEN = twitter.obtain_access_token()
twitter = Twython(APP_KEY, access_token=ACCESS_TOKEN)
query = “keyword”
# HTTP request
# get 1
res = twitter.search(q=query, count=1, result_type="recent")
Having read up to this point, I still encounter this error.
TwythonError: Twitter API returned a 403 (Forbidden), You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here:
I want to know cause of error and run thit code well.
tom is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.