使用下面的python代码,当身份验证成功时,我收到以下错误:
错误代码:453:您当前只能访问 Twitter API v2 端点的子集和有限的 v1.1 端点(例如媒体发布、oauth)。如果您需要访问此端点,您可能需要不同的访问级别。您可以在这里了解更多信息:https://developer.twitter.com/en/portal/product
我目前在 developer.twitter.com 使用 free 版本。
代码:
import tweepy
# Authenticate to Twitter
auth = tweepy.OAuthHandler("CONSUMER_KEY", "CONSUMER_SECRET")
auth.set_access_token("ACCESS_TOKEN", "ACCESS_TOKEN_SECRET")
# Create API object
api = tweepy.API(auth)
try:
api.verify_credentials()
print("Authentication OK")
except:
print("Error during authentication")
# Create a tweet
api.update_status("content of tweet")
在这个链接中,正确的访问方式描述如下:
免费
- 用于只写用例和测试 Twitter API
- 对 v2 推文发布和媒体上传端点的访问进行速率限制
- 每月 1,500 条推文 - 应用程序级别的发布限制
- 1 个应用程序 ID
- 使用 Twitter 登录
这是错误日志:
验证成功
回溯(最近一次调用最后一次):文件“..