I am trying to get trending tweets in a location but everytime I run this in python I get this error below that tells me I need to get elevated access even though my account says I have elevated access, any help would be greatly appreciated

tweepy.errors.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: Getting Started with the Twitter API | Docs | Twitter Developer Platform

What exact code / library are you using and what calls are you making?

Did you reset your token after adding the app to a Project as a Production App? Do other v1.1 API endpoints work? GET account/verify_credentials | Docs | Twitter Developer Platform Do your credentials work for v2? GET /2/users/me | Docs | Twitter Developer Platform

I am using python and tweepy library to try to get trending data. No none of the v1.1 API endpoints work for me, I don’ understand though because I presume if you have the elevated account you would have the essential permissions + the new ones from elevated?

If you see the attached image you can see it says I have an elevated account.

In this screenshot though I see there is something about “standalone apps” I wonder if this is what is causing the issue, but I am using the keys from the app I have created which says (as you can see in the image) that I have v2 and v1.1 access rights

load_dotenv()
api_key=os.environ[‘API_KEY’] #os.getenv(“API_KEY”),
api_key_secret=os.environ[‘API_KEY_SECRET’] #os.getenv(“API_KEY_SECRET”),
access_token=os.environ[‘ACCESS_TOKEN’] #os.getenv(“ACCESS_TOKEN”),
access_token_secret=os.environ[‘ACCESS_TOKEN_SECRET’] #os.getenv(“ACCESS_TOKEN_SECRET”)
bearer_token=os.environ[‘BearerToken’]
#)

print(api_key, access_token, access_token_secret, api_key_secret)
auth = tweepy.OAuthHandler(api_key, api_key_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
print(api)
available_loc = api.available_trends()
print(available_loc)

1 Like

Does it work if you remove your app from the Project, and Add it again as a “Production App” ?

2 Likes

Not sure I will try this.

(post deleted by author)

Yes this worked when I set it to production environment, thanks a lot for the help with this

3 Likes

Hey there team,

We believe we’ve found the root cause to this and have implemented a fix. If you have the time to test, that would be greatly appreciated! If not, no worries.

Thanks for surfacing and sorry for the inconvenience!

2 Likes

Oh cool thanks, I should be able to test it next week sometime. I’ll update once I check.

Thanks

Do you think this could also work for this topic:
Twitter Query including a list_id with tweepy python - #3 by anitasanchop ?

Hi! I have a similar problem in this topic: Twitter Query including a list_id with tweepy python - #3 by anitasanchop

Hi @LeBraat just got around to testing this now and it works thanks for the help!

1 Like

Hey all,

I’ve just spent most of the day investigating this (and almost pulling my hair out :sweat_smile:) and the fix was to use the “Production” env app to be able to use v1.1 API…

In dev env all I get is error 453.

Is this a bug @LeBraat or expected behaviour?

Glad I found this discussion now I can go get some sleep…

Cheers,
Peter

1 Like

Ya the same for me I was so confused and spent so much time wondering what I did wrong but I’m glad this community forum is so good once I messaged in here my problems were resolved very quickly

1 Like

Great to hear it all got resolved for you @hession_patrick - does this mean you can now use v1.1 in dev env? Just triple checking :raised_hands:

No I had to change to production then it worked for me

1 Like

Thanks Patrick, @LeBraat so it looks like a bug in dev env? :beetle::eyes:

Thank you for reporting – Can you all please provide the handle that your dev account is set up with, the App IDs that you are working with, and any other relevant information that can help our eng team investigate?