twython icon indicating copy to clipboard operation
twython copied to clipboard

Add support for Twitter API v2

Open LinqLover opened this issue 2 years ago • 1 comments

As of 2021-11-15, new users can only use the v2 version of the API unless they are granted elevated access:

Twitter API returned a 403 (Forbidden), 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-leve

Unfortunately, twython appears to be hard-coded to v1, or at least I did not find out how to use the v2 endpoints. It would be great if support or docs for this could be added!

LinqLover avatar Dec 18 '21 18:12 LinqLover

Ah, damn, that's crazy.

Unfortunately I just don't use Twython myself much these days... so this isn't something I can devote my time to. If someone wanted to update the library to use v2 endpoints I'm happy to review and merge though; endpoints.py is fairly well laid out and unless much has changed with the authentication rituals, it should just be a matter of updating that (or creating an endpoints_v2 of sorts) and tweaking the main lib slightly to use it.

ryanmcgrath avatar Dec 19 '21 06:12 ryanmcgrath