How do I solve issues related to twitter API? I have written the below block of code and I am getting the error: "Forbidden"

Viewed 98
'''
consumer_key = "XXXX" #twitter consumer key 
consumer_secret = "XXXX" #twitter consumer secret
access_token = "XXXX" #twitter acess token
access_secret = "XXXX" #access secret

auth = tweepy.OAuthHandler(consumer_key, consumer_secret) #authentication
auth.set_access_token(access_token, access_secret)
api = tweepy.API(auth)

public_tweets = api.home_timeline()

for tweet in public_tweets:
    print(tweet)
'''
**I am getting the below error message**

Forbidden: 403 Forbidden 453 - You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-level

0 Answers
Related