我遇到了一个问题。
尝试运行以下代码,使用Twitter API和Tweepy获取用户的帖子历史记录时:
我的应用似乎与一个项目连接在一起(见图) 我找到了一些链接,表明这可能是与API身份验证有关的Twitter问题。然而,我想确认一下是否确实如此,并且是否有任何可能的解决方案或解决此问题的方法。
表明可能是Twitter问题的链接:
tweepy.errors.Forbidden: 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.
尝试运行以下代码,使用Twitter API和Tweepy获取用户的帖子历史记录时:
client = tweepy.Client(bearer_token=bearer_token)
tweets = client.search_recent_tweets(query=f'from:{user_handle}')
我的应用似乎与一个项目连接在一起(见图) 我找到了一些链接,表明这可能是与API身份验证有关的Twitter问题。然而,我想确认一下是否确实如此,并且是否有任何可能的解决方案或解决此问题的方法。
表明可能是Twitter问题的链接:
https://github.com/twitterdev/Twitter-API-v2-sample-code/issues/58 https://twittercommunity.com/t/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/189699
我非常感激任何关于解决这个问题的见解、解释或潜在解决方案。