xdevplatform / Twitter-API-v2-sample-code

Sample code for the Twitter API v2 endpoints
https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api
Apache License 2.0
2.61k stars 967 forks source link

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

Open aseprite1 opened 1 year ago

aseprite1 commented 1 year ago

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.

MarijaErason commented 1 year ago

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! :)

stevenvdhorst commented 1 year ago

I am having the exact same problem since today.

sher9n commented 1 year ago

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

davidnyseen commented 1 year ago

same here

xiaoshengaimm commented 1 year ago

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!!!

GuillaumeCisco commented 1 year ago

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

I'm also using tweepy.

stevenvdhorst commented 1 year ago

Has anyone found a fix yet?

SaladAuthority commented 1 year ago

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?

mksmhdb commented 1 year ago

Same issue here

aseprite1 commented 1 year ago

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

pkilller commented 1 year ago

twitter made a mess of shit。

alextes commented 1 year ago
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 🙈 .

xiaoshengaimm commented 1 year ago

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

stevenvdhorst commented 1 year ago

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

eth0izzle commented 1 year ago

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

Fabien-desablens commented 1 year ago

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.

W72H commented 12 months ago

DId anyone find a solution?

sshah98 commented 11 months ago

getting the same issue

verges-io commented 11 months ago

Same problem here.

sire-ambrose commented 11 months ago

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!')

rameman commented 10 months ago

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.

MuhammedQuresh commented 10 months ago

Anyone found a solution yet?

MuhammedQuresh commented 10 months ago

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

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

MuhammedQuresh commented 10 months ago

I wasn't replying to you

xiaowei6688 commented 8 months ago

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

SatyaBipros commented 6 months ago

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

FrankLoud commented 6 months ago

create_tweet

also 403 Forbidden

huojiecs110 commented 6 months ago

GET /2/users/:id/以下

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

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

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

huojiecs110 commented 6 months ago

创建推文

还有403禁止 111

huojiecs110 commented 6 months ago

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

pass-pass-pass commented 3 months ago

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

Hello, how did you solve the issue?