首页 > 解决方案 > 为什么我从 twitter api 收到 Rate limit exceeded 错误 88?

问题描述

我只从我自己的时间线发送 4 条推文的请求。根据 twitter 网站,我应该能够使用我的 v2 Standard Basic 访问帐户每 15 分钟收到数百条推文。我看不出我是如何通过请求 4 条推文来达到这个限制的,而且我的推特账户本身只有 18 条推文(不知道这些是否包括在内,因为我只请求了其中的 4 条)。

我将展示我的代码,以便您了解我是如何使用 Twitter API 的。

这是获取 4 条推文的函数:

def toon_tweets():
r = api.request('statuses/home_timeline', {'count':4})
tweet_lijst = []
for item in r.get_iterator():
    if 'text' in item:
        tweet_lijst.append(item['text'])

return tweet_lijst

我通过以下方式从另一个应用程序调用此函数:

tweets_label = Label(root,fg = "#0313fc" , bg = "#ffcc00",
            #text = ns_m3_testB.toon_tweets(),
            text = "{}\n {}\n {}\n {}".format(ns_m3_testB.toon_tweets()[0], ns_m3_testB.toon_tweets()[1], ns_m3_testB.toon_tweets()[2], ns_m3_testB.toon_tweets()[3]),    
            font = "none 14 bold",
            justify = "left")

我不知道这么简单的请求怎么会导致我超过速率限制。

标签: pythontwittertwitterapi-python

解决方案


推荐阅读