您目前具有基本访问权限,仅包括访问 Twitter API v2 端点。

10
import tweepy
import json
import pandas as pd

API_KEY = ''
API_SECRET = ' '
access_token = ''
access_token_seceret =''

auth = tweepy.OAuthHandler(API_KEY, API_SECRET)

api = tweepy.API(auth)

这段代码一直以来都会出现以下错误,请问有谁可以帮我找出如何解决这个问题?我是编程新手。
facebooktweets = api.user_timeline("Meta")

     ---------------------------------------------------------------------------
     TweepError                                Traceback (most recent call last)
     <ipython-input-8-96959e05857f> in <module>()
      ----> 1 facebooktweets = api.user_timeline("Meta")

      1 frames
      /usr/local/lib/python3.7/dist-packages/tweepy/binder.py in execute(self)
      232                     raise RateLimitError(error_msg, resp)
      233                 else:
  --> 234                     raise TweepError(error_msg, resp, api_code=api_error_code)
      235 
      236             # Parse the response payload

     TweepError: [{'message': 'You currently have Essential access which includes access 
     to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need 
     to apply for Elevated access via the Developer Portal. You can learn more here: 
     https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter- 
     api#v2-access-leve', 'code': 453}]

1
错误信息告诉您确切的操作 - 通过开发者门户申请提升访问权限。另一种选择是使用Twitter API v2版本的user_timeline函数,即get_users_tweets - Andy Piper
2个回答

3

你如何获取v1.1的访问权限?我在开始构建我的应用程序时有访问权限,但突然间它消失了。现在它说我只能访问v2端点,但我无法使用任何v2端点,因为在我的开发者门户中它明确表示我只能访问v1.1,但我仍然收到这个消息。 - Martin Erlic
@MartinErlic 点击这里查看。现在都不再免费访问。 - undefined

1

似乎不再有免费访问了。停止机器人可能是一件好事。

在 twitter 上查看更新 here


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接