I can’t figure out why the authentication fails, Even when I regenerate keys and tokens I’ll get an “Authentication Error”. how can I get to the bottom of this?

import tweepy

# Authenticate to Twitter
auth = tweepy.OAuthHandler("consmer_key", "consumer_secret")
auth.set_access_token("api_key", "api_secret")
api = tweepy.API(auth)

try:
    api.verify_credentials()
    print("Authentication Successful")
except:
    print("Authentication Error")

This is using the v1.1 API, not the v2 API - you need Client — tweepy 4.10.1 documentation and v2 does not have an equivalent for .verify_credentials() so that won’t work.

To use the v1.1 API, you need to have “Elevated” access to the API, the default is “Essential”

1 Like

with your suggestion I tried to get an elevated accept but I got rejected. Even though I got an email that said: Your Twitter developer account application was not approved.
But in the dashboard i can’t file another application because it still says “pending”