Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project #58

Closed
yeatfaicheong opened this issue Oct 10, 2021 · 177 comments
Assignees
Labels
bug Something isn't working

Comments

@yeatfaicheong
Copy link

yeatfaicheong commented Oct 10, 2021

Describe the bug
Cannot get rules (HTTP 403): {"client_id":"xxxxx","detail":"When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.","registration_url":"https://developer.twitter.com/en/docs/projects/overview","title":"Client Forbidden","required_enrollment":"Standard Basic","reason":"client-not-enrolled","type":"https://api.twitter.com/2/problems/client-forbidden"}

To Reproduce

  1. Create environment variable with Bearer token.
  2. Run the py script.
@yeatfaicheong yeatfaicheong added the bug Something isn't working label Oct 10, 2021
@yeatfaicheong
Copy link
Author

I have found the issue. I got this error because although I had the Twitter developer App, but it was a STANDALONE app without attaching to any projects.
So, creating a project first and then link to the app is essential to use Twitter API v2.

@andypiper andypiper self-assigned this Oct 11, 2021
@brandon-yilmaz
Copy link

Hi! i have the same error, how can i attach an app to a project? thanks

@andypiper
Copy link
Contributor

In the developer dashboard, you should be able to create a Project and add an App. Do you have an approved developer account with access to the dashboard?

@mariem-snoussi
Copy link

mariem-snoussi commented Mar 9, 2022

My app is already attached to a project, any ideas as to why it's happening still ? This is only happening with the TweetCount script but other scripts work just fine.

@sriharigr-threado
Copy link

Hello, even we are facing a similar issue but on v2/search/all. We do have a premium subscription for Full Archive.

@Rushipatel0995
Copy link

Hi, I have my app inside a project still facing the same error. Could anyone please help?

@sriharigr-threado
Copy link

Hi, I have my app inside a project still facing the same error. Could anyone please help?

Hey, in my case, the reason was Full Archive in v2 is available only Academic Research. You can use 1.1v for Full Archive Search

@blhprasanna99
Copy link

Hey , I have academic access ..... I too got same error.....anyone knows why?

@jiarui-liu
Copy link

@blhprasanna99 Hi, did you find where the problem is? I also have academic access and got this problem...

@tipu404
Copy link

tipu404 commented May 17, 2022

@Jerry-Liu-dot Hi, I have the same problem despite having academic access. Did you find the problem?

@blhprasanna99
Copy link

@blhprasanna99 Hi, did you find where the problem is? I also have academic access and got this problem...

Hello!!.....I checked and got academic access again . I was able to complete the work by following the below code
https://github.com/jdfoote/Intro-to-Programming-and-Data-Science/blob/fall2021/extra_topics/twitter_v2_example.ipynb

@csalmeida
Copy link

I am having the same issue accessing https://api.twitter.com/2/tweets/search/all.

It seems that Essential Access is not enough and you'll get the following error:

{
	"client_id": "20012345",
	"detail": "When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.",
	"registration_url": "https://developer.twitter.com/en/docs/projects/overview",
	"title": "Client Forbidden",
	"required_enrollment": "Standard Basic",
	"reason": "client-not-enrolled",
	"type": "https://api.twitter.com/2/problems/client-forbidden"
}

It seems in my case Extended Access is required to access the endpoint.

@andypiper
Copy link
Contributor

andypiper commented Oct 13, 2022

@csalmeida you need Academic access to call the full archive search (/2/tweets/search/all) endpoint.

@ajeetlabs
Copy link

@blhprasanna99 Hi, did you find where the problem is? I also have academic access and got this problem...

Hello!!.....I checked and got academic access again . I was able to complete the work by following the below code https://github.com/jdfoote/Intro-to-Programming-and-Data-Science/blob/fall2021/extra_topics/twitter_v2_example.ipynb

@blhprasanna99 hey please tell me how you have solved it.

@blhprasanna99
Copy link

@blhprasanna99 Hi, did you find where the problem is? I also have academic access and got this problem...

Hello!!.....I checked and got academic access again. I was able to complete the work by following the below code https://github.com/jdfoote/Intro-to-Programming-and-Data-Science/blob/fall2021/extra_topics/twitter_v2_example.ipynb

@blhprasanna99 hey please tell me how you have solved it.

@ajeetlabs .. I used the code from the link. Please make sure that you got academic research access. You can retrieve the data using that code if you have correct access.
I

@rico0610
Copy link

This error is back again. My app is already attached to a project but still throwing this error.

@Ganymede23
Copy link

This error is back again. My app is already attached to a project but still throwing this error.

Happened to me to today too. I had to regenerate all my keys and tokens.

@rico0610
Copy link

rico0610 commented Apr 23, 2023

This error is back again. My app is already attached to a project but still throwing this error.

Happened to me to today too. I had to regenerate all my keys and tokens.

Did that resolve the issue on your end? Mine is still has the same error even after deleting the app and project and creating a new one.

@Ganymede23
Copy link

This error is back again. My app is already attached to a project but still throwing this error.

Happened to me to today too. I had to regenerate all my keys and tokens.

Did that resolve the issue on your end? Mine is still has the same error even after deleting the app and project and creating a new one.

Sorry to hear that. Yes, in my case if did fix the issue.

@rico0610
Copy link

This error is back again. My app is already attached to a project but still throwing this error.

Happened to me to today too. I had to regenerate all my keys and tokens.

Did that resolve the issue on your end? Mine is still has the same error even after deleting the app and project and creating a new one.

Sorry to hear that. Yes, in my case if did fix the issue.

Great to know. Are you using a new account or still using the old plans like Essentials and others?

@Ganymede23
Copy link

This error is back again. My app is already attached to a project but still throwing this error.

Happened to me to today too. I had to regenerate all my keys and tokens.

Did that resolve the issue on your end? Mine is still has the same error even after deleting the app and project and creating a new one.

Sorry to hear that. Yes, in my case if did fix the issue.

Great to know. Are you using a new account or still using the old plans like Essentials and others?

I've had my Developer account since mid-2022. I currently have the Free plan. Before that, I also had the most basic plan (Essential). I've never had to send a request for Elevated or Academic access.
I did get my App 'banned' a few days ago without explanation (apparently lots of people had that issue last week), so I had to create it again. But that was it.

@rico0610
Copy link

rico0610 commented Apr 24, 2023

This error is back again. My app is already attached to a project but still throwing this error.

Happened to me to today too. I had to regenerate all my keys and tokens.

Did that resolve the issue on your end? Mine is still has the same error even after deleting the app and project and creating a new one.

Sorry to hear that. Yes, in my case if did fix the issue.

Great to know. Are you using a new account or still using the old plans like Essentials and others?

I've had my Developer account since mid-2022. I currently have the Free plan. Before that, I also had the most basic plan (Essential). I've never had to send a request for Elevated or Academic access. I did get my App 'banned' a few days ago without explanation (apparently lots of people had that issue last week), so I had to create it again. But that was it.

Thank you. I'm experiencing the issue with the new account I've created. My old account with essential plan is working just fine.

@Velkonost
Copy link

hello
I regenerated too but didn't help

@Uncle-Enzo
Copy link

From the python example supplied in this repo:

response = requests.get(
"https://api.twitter.com/2/tweets/search/stream/rules", auth=bearer_oauth

Fails...despite the bearer token being valid.

@Kellogs
Copy link

Kellogs commented Apr 28, 2023

Hi

I am facing similar issues.

  1. Created a New Account for Free API Access
  2. It automatically creates and binds it to a project name (not of my choosing, no option to add/edit existing project but I can see it) e.g. I can see at the top "Default project-165131599485..."
  3. Can post a Tweet with no issue, so my keys are clearly working (using Tweepy 'response = client.create_tweet(text=tweet_text)'
  4. however if I try RT a tweet using 'client.retweet(tweetid)' I receive the same message (below)?

"When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal."

Thank you all

@Kellogs
Copy link

Kellogs commented Apr 28, 2023

Forgot to add, I have regenerated all the keys and it made no difference i.e. cat post a tweet but can't RT a tweet

@AndreaZero
Copy link

Can't believe this... I stil can't use the API for this issue,

@trimbilrepo
Copy link

you need subscription to be able to use the API...
I have the same problem then tried to use "pro" account and everything working fine...

@nezirz
Copy link

nezirz commented Aug 22, 2023

fuck...ing elon and his games.. took me days and still problems.

@Machzy
Copy link

Machzy commented Aug 22, 2023

fuck...ing elon and his games.. took me days and still problems.

Have you tried paying $40,000 or whatever the hell gets you the super duper ultra API subscription?

@Bojangly
Copy link

Bojangly commented Oct 8, 2023

It appears twitter has locked this behind Pro. I have tested Basic and it does not work. Can someone confirm if this works with Pro?

@xsamir
Copy link

xsamir commented Oct 13, 2023

Still with the same issue:
detail":"When authenticating requests to the Twitter API v2 endpoints, you must use keys and to (truncated...)

I think they want us to subscribe for the 40K package ...!

@shivam017arora
Copy link

so after a lot of thinking and coffee and reading the docs I got it to work

if you have the free v2 package then you only have 3 of the APIs available as of Oct 2023:

POST /2/tweets
DELETE /2/tweets/:id
GET /2/users/me

For the /u/users/me and free package that I wanted to use, it doesn't take the BEARER token / App Only Auth but it requires you to sign with the Access Token in the request, I followed the code in example repo given by GitHub where you have to give you secret key and client ID.

https://github.com/twitterdev/Twitter-API-v2-sample-code/blob/main/User-Lookup/get_users_me_with_user_context.js

Hope this helps

@trimbilrepo
Copy link

It appears twitter has locked this behind Pro. I have tested Basic and it does not work. Can someone confirm if this works with Pro?

I can confirm it working just fine with pro...

@g1gaswagg
Copy link

thats so sad :(

@8ahmedanwer8
Copy link

@shivam017arora where does it say in their documentation that free tier doesn't give access to other endpoints?

@yangcheng
Copy link

so after a lot of thinking and coffee and reading the docs I got it to work

if you have the free v2 package then you only have 3 of the APIs available as of Oct 2023:

POST /2/tweets
DELETE /2/tweets/:id
GET /2/users/me

For the /u/users/me and free package that I wanted to use, it doesn't take the BEARER token / App Only Auth but it requires you to sign with the Access Token in the request, I followed the code in example repo given by GitHub where you have to give you secret key and client ID.

https://github.com/twitterdev/Twitter-API-v2-sample-code/blob/main/User-Lookup/get_users_me_with_user_context.js

Hope this helps

that's so bad, thanks a lot for sharing! you saved me many hours

@Machzy
Copy link

Machzy commented Nov 12, 2023

so after a lot of thinking and coffee and reading the docs I got it to work

if you have the free v2 package then you only have 3 of the APIs available as of Oct 2023:

POST /2/tweets
DELETE /2/tweets/:id
GET /2/users/me

For the /u/users/me and free package that I wanted to use, it doesn't take the BEARER token / App Only Auth but it requires you to sign with the Access Token in the request, I followed the code in example repo given by GitHub where you have to give you secret key and client ID.

https://github.com/twitterdev/Twitter-API-v2-sample-code/blob/main/User-Lookup/get_users_me_with_user_context.js

Hope this helps

I'm trying to build a real-time twitter retweeting bot that is listening to another account, but if there are any keywords in the tweet that are part of my exclusion list, it won't retweet those tweets.

Can I do that with the free version?

@MAkif06
Copy link

MAkif06 commented Nov 17, 2023

Hi,

I have the same error. I have a maven project. When I want to get user with user id from twitter api v2 I am getting this error "When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal."

I have project and I have a app which attached with this project but still I am getting this error. How can I solve this error ?

Note: I have a free developer account.

project and app

@crazyNing
Copy link

after buy basic plan,i try to delete my app and project, and then it work.
在购买Basic订阅之后,我尝试删除了我的APP和Project然后重新创建他们,然后重新生成Token,再请求就可以了,注意一天之内不要创建超过3次APP,否则会被封号24小时

@MAkif06
Copy link

MAkif06 commented Nov 20, 2023

after buy basic plan,i try to delete my app and project, and then it work. 在购买Basic订阅之后,我尝试删除了我的APP和Project然后重新创建他们,然后重新生成Token,再请求就可以了,注意一天之内不要创建超过3次APP,否则会被封号24小时

Yes that is the solution. When I pass the basic plan, that error is solved. Thanks for everythink.

@hongqiww
Copy link

FYI, here is the announcement: https://twittercommunity.com/t/understanding-the-error-453-you-currently-have-access-to-a-subset-of-twitter-api-v2-endpoints/200361

@TalaN1993
Copy link

Hi,

I have the same error. I have a maven project. When I want to get user with user id from twitter api v2 I am getting this error "When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal."

I have project and I have a app which attached with this project but still I am getting this error. How can I solve this error ?

Note: I have a free developer account.

project and app

I have this problem, if you find a way, pls tell me

@TalaN1993
Copy link

after buy basic plan,i try to delete my app and project, and then it work. 在购买Basic订阅之后,我尝试删除了我的APP和Project然后重新创建他们,然后重新生成Token,再请求就可以了,注意一天之内不要创建超过3次APP,否则会被封号24小时

Yes that is the solution. When I pass the basic plan, that error is solved. Thanks for everythink.

I have this proble, and cannot handle that. please give me clue.

@TalaN1993
Copy link

after buy basic plan,i try to delete my app and project, and then it work. 在购买Basic订阅之后,我尝试删除了我的APP和Project然后重新创建他们,然后重新生成Token,再请求就可以了,注意一天之内不要创建超过3次APP,否则会被封号24小时

If we want to use free accesss, not basic, how ca we handle this error?, it just solve with basic account?

@crazyNing
Copy link

after buy basic plan,i try to delete my app and project, and then it work. 在购买Basic订阅之后,我尝试删除了我的APP和Project然后重新创建他们,然后重新生成Token,再请求就可以了,注意一天之内不要创建超过3次APP,否则会被封号24小时

If we want to use free accesss, not basic, how ca we handle this error?, it just solve with basic account?

Now, both basic and professional subscriptions are not working. You must use an enterprise subscription to use it, which is $42000 a month. Praise Elon Musk

@TalaN1993
Copy link

after buy basic plan,i try to delete my app and project, and then it work. 在购买Basic订阅之后,我尝试删除了我的APP和Project然后重新创建他们,然后重新生成Token,再请求就可以了,注意一天之内不要创建超过3次APP,否则会被封号24小时

If we want to use free accesss, not basic, how ca we handle this error?, it just solve with basic account?

Now, both basic and professional subscriptions are not working. You must use an enterprise subscription to use it, which is $42000 a month. Praise Elon Musk

It's crazy. What another platfrom you suggest to use instead Twitter?, For my research in Ph.d I need to extract people's experiences in specific city by considering the location?,

@MAkif06
Copy link

MAkif06 commented Dec 18, 2023

Hi,
I have the same error. I have a maven project. When I want to get user with user id from twitter api v2 I am getting this error "When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal."
I have project and I have a app which attached with this project but still I am getting this error. How can I solve this error ?
Note: I have a free developer account.
project and app

I have this problem, if you find a way, pls tell me

When I passed free plan to basic plan this error had been solved. You should buy basic plan. Before the buy this plan, you should read features of this plan. If these fetaures useful for your Ph.d works, you can buy it.

@luongs3
Copy link

luongs3 commented Jan 31, 2024

The problem is free plan package. Upgrate to Basic plan guys.
Screenshot from 2024-01-31 14-07-37

@abd-4fg
Copy link

abd-4fg commented Apr 2, 2024

Twitter Team , just remove the free tier when its complete useless .
OR FIX THE DAMN ERROR THAT EVERYONE IS FACING including me!
STOP WASTING PEOPLE TIME .

@zcharef
Copy link

zcharef commented Apr 5, 2024

Yeah same problem. It drove me crazy trying to figure out what's wrong.
Can we use the V1 API for free without too much limitations or we need to pay the Basic plan even for V1 API ?

@www222fff
Copy link

If not supported for free plan, please remove not to abstract...

@pvankadari
Copy link

Hi I have signed up for free access and I get the error When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal. I could see a default project and app has been create for the same. The key and tokens being used are from the default project. Cant figure out why it is still throwing up

@luan1412167
Copy link

I have this issue even though I paid $5,000/month for a Pro subscription.!!! Fuck elon!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests