Twitter-API-v2-sample-code icon indicating copy to clipboard operation
Twitter-API-v2-sample-code copied to clipboard

[Bug Report] Error 403 Forbidden when using GET /2/users/:id/following with Twitter API v2 endpoint

Open aseprite1 opened this issue 2 years ago • 32 comments

Describe the bug Hello, I am currently subscribed to the $100 Basic Plan. I encountered a bug while using the Twitter API v2 endpoint with the GET /2/users/:id/following method.

When making the request, I received the following error message: "403 Forbidden 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 want to highlight that my app is already attached to a project, and I am not the only user experiencing this bug. Several other users are also encountering the same issue.

Please investigate this bug and take the necessary actions to resolve it as soon as possible. If you require any additional information, such as screenshots or logs, please let me know.

Thank you for your attention to this matter.

aseprite1 avatar Jun 27 '23 07:06 aseprite1

I'm using the basic plan (100$ monthly) and untill this morning I was able to pull the followers/followings of the user. I use tweepy and create tweepy.Client object using only the bearer_token. My app is under the project, so that is not an issue.
This is so unreliable if every other day some new unexplainable error will pop up.

In case anyone experiences any changes (API working) please write here. Thank you! :)

MarijaErason avatar Jun 27 '23 07:06 MarijaErason

I am having the exact same problem since today.

stevenvdhorst avatar Jun 27 '23 07:06 stevenvdhorst

We're having the exact same problem too! As of 2 hours ago. Why is the API so unstable?!

sher9n avatar Jun 27 '23 07:06 sher9n

same here

davidnyseen avatar Jun 27 '23 11:06 davidnyseen

We have the same issue. We are already basic plan and paid 100$ every month. But When we get someone followers by api, we got this error. We can get the follow list before but today we got this error. And We detached the app and re-attach it to the project, but not be solved. It's crazy for that we can not get any accurate information from the error message. The additional information is that our Tweet caps - pull is fulled. Is it related to this???

Anyone help for that!!!

xiaoshengaimm avatar Jun 27 '23 11:06 xiaoshengaimm

Having exactly the same issue on followers and following. But getting a user from its username is fine.

I'm also using tweepy.

GuillaumeCisco avatar Jun 27 '23 11:06 GuillaumeCisco

Has anyone found a fix yet?

stevenvdhorst avatar Jun 27 '23 18:06 stevenvdhorst

Also getting this error

Api docs are returning a 404 (https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/get-users-id-followers)

I hope this API is not getting deprecated?

SaladAuthority avatar Jun 28 '23 00:06 SaladAuthority

Same issue here

mksmhdb avatar Jun 28 '23 09:06 mksmhdb

Their updated documentation lacks GET /2/users/:id/following 😂 I can't believe this is an expensive paid API.

https://developer.twitter.com/en/docs/twitter-api/rate-limits#v2-limits

aseprite1 avatar Jun 29 '23 06:06 aseprite1

twitter made a mess of shit。

pkilller avatar Jun 30 '23 08:06 pkilller

Screenshot 2023-06-30 at 11 22 04

The changelog appears to be for the v1.1 API.

Here is the community developer forum topic: https://twittercommunity.com/t/get-2-users-id-following-is-now-broken/197526

No solutions there either as of now.

For the v1.1 endpoint you get the following on basic paid access btw, 453 code with: "You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product".

EDIT: what am I saying 😂 , it literally says for the v2 API in the message. Probably the label is wrong 🤔 ? They even managed to break the message 🙈 .

alextes avatar Jun 30 '23 09:06 alextes

Twitter is crazy poor. Two api need pay $42000 a month..............

xiaoshengaimm avatar Jun 30 '23 10:06 xiaoshengaimm

Has anyone found anything yet? It's been a week lol

stevenvdhorst avatar Jul 03 '23 15:07 stevenvdhorst

What's the workaround for this? I guess we'll have to scrape?

eth0izzle avatar Jul 10 '23 13:07 eth0izzle

same issue here using bearer token to authenticate: 403 Forbidden 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.

Fabien-desablens avatar Jul 20 '23 04:07 Fabien-desablens

DId anyone find a solution?

W72H avatar Jul 23 '23 06:07 W72H

getting the same issue

sshah98 avatar Aug 10 '23 17:08 sshah98

Same problem here.

verges-io avatar Aug 10 '23 20:08 verges-io

if you are using python tweepy, use the create_tweet instead of update_status

client = tweepy.Client(consumer_key =CONSUMER_KEY, consumer_secret =CONSUMER_SECRET, access_token =ACCESS_KEY, access_token_secret =ACCESS_SECRET)

client.create_tweet(text='Hello World!')

ambroseikpele avatar Aug 19 '23 18:08 ambroseikpele

if you are using python tweepy, use the create_tweet instead of update_status

client = tweepy.Client(consumer_key =CONSUMER_KEY, consumer_secret =CONSUMER_SECRET, access_token =ACCESS_KEY, access_token_secret =ACCESS_SECRET)

client.create_tweet(text='Hello World!')

Is there any way to attach images without using "tweepy.API" as it gives error and "tweepy.Client" does not allow to attach images.

rameman avatar Aug 27 '23 10:08 rameman

Anyone found a solution yet?

MuhammedQuresh avatar Aug 29 '23 15:08 MuhammedQuresh

https://api.twitter.com/2/users/me?user.fields=public_metrics

Thats the solution to get total followers count and following count.

MuhammedQuresh avatar Aug 30 '23 13:08 MuhammedQuresh

I wasn't replying to you

MuhammedQuresh avatar Aug 30 '23 13:08 MuhammedQuresh

GET /2/users/:id/following

I am currently experiencing a problem when using consumer_ Key and consumer_ 401 Unauthorized appears during secret authentication. Using Bearer_ Token undergoes 2.0 authentication and appears as: 403 Forbidden 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 am certain that all the information is correct because all other interfaces can be used normally. I'm thinking how to solve this problem? thanks

xiaowei6688 avatar Nov 10 '23 09:11 xiaowei6688

Facing same issue with basic plan, anyone have solution yet??

SatyaBipros avatar Dec 30 '23 18:12 SatyaBipros

create_tweet

also 403 Forbidden

FrankLoud avatar Jan 01 '24 14:01 FrankLoud

GET /2/users/:id/以下

我目前在使用consumer_Key和consumer_Key时遇到问题,在秘密认证过程中出现401 Unauthorized。使用 Bearer_ Token 会经历 2.0 身份验证,并显示为:403 Forbidden 对 Twitter API v2 端点的请求进行身份验证时,您必须使用附加到项目的 Twitter 开发人员应用程序中的密钥和令牌。您可以通过开发者门户创建项目。

我确信所有信息都是正确的,因为所有其他接口都可以正常使用。我在想如何解决这个问题?谢谢

我通过第三方服务解决的验证关注者信息~~需要的话加VX cs_125569489

huojiecs110 avatar Jan 02 '24 01:01 huojiecs110

创建推文

还有403禁止 111

huojiecs110 avatar Jan 02 '24 01:01 huojiecs110

Facing same issue with basic plan, anyone have sol 222 ution yet??

huojiecs110 avatar Jan 02 '24 02:01 huojiecs110