Using the below python code, while the authentication is successful, I get the following error:
Error Code: 453: 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: https://developer.twitter.com/en/portal/product
I am currently using the free version on developer.twitter.com.
Code:
import tweepy
# Authenticate to Twitter
auth = tweepy.OAuthHandler("CONSUMER_KEY", "CONSUMER_SECRET")
auth.set_access_token("ACCESS_TOKEN", "ACCESS_TOKEN_SECRET")
# Create API object
api = tweepy.API(auth)
try:
api.verify_credentials()
print("Authentication OK")
except:
print("Error during authentication")
# Create a tweet
api.update_status("content of tweet")
In this link, the right access is described as follows:
Free
- For write-only use cases and testing the Twitter API
- Rate limited access to v2 tweet posting and media upload endpoints
- 1,500 Tweets per month - posting limit at the app level
- 1 app ID
- Login with Twitter
And this is error log:
Authentication OK
Traceback (most recent call last): File "...\create_tweet.py", line 19, in api.update_status('content of tweet') File "...\tweepy\api.py", line 46, in wrapper
return method(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:...\tweepy\api.py", line 979, in update_status return self.request( ^^^^^^^^^^^^^ File "C:...\tweepy\api.py", line 271, in request
raise Forbidden(resp) tweepy.errors.Forbidden: 403 Forbidden 453 - 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: https://developer.twitter.com/en/portal/product
api.update_status('image_path/image_name.jpg')
? I tried this but got the same error message as before. – Unbidden