【问题标题】:Rate Limit in Twitter REST API - a clarification neededTwitter REST API 中的速率限制 - 需要澄清
【发布时间】:2014-06-09 15:41:14
【问题描述】:

我正在使用 R 访问 Twitter 的 REST API。从开发者网站(https://dev.twitter.com/docs/rate-limiting/1.1/limits)我了解到,推特搜索推文的速率限制为每 15 分钟 450 次。

我的问题是:我使用以下代码达到的费率是多少:是 5(单独请求 5 天)还是 500(5 天 * 100 条推文)?

dates <- paste("2014-03-",c(10:15),sep="") 
for (i in 2:length(dates)) {
  print(paste(dates[i-1], dates[i]))
  tweetList <- c(tweetList, searchTwitter("#ddj", since=dates[i-1], until=dates[i], n=100))
}

【问题讨论】:

  • 您需要阅读 searchTwitter() 的源代码以查看它发出了多少请求。

标签: r rest twitter rate-limiting


【解决方案1】:

对于 GET 搜索/推文查询,您已达到 180 API 调用/15 分钟的限制: https://dev.twitter.com/docs/api/1.1/get/search/tweets。如果您使用的是 twitteR 软件包,您可以使用

检查您达到的限制
getCurRateLimitInfo()

编辑:

再次思考你的问题。如果您向我们提供了 R 向您抛出的错误,告诉您会更容易,但我认为这可能与日期有关。

Twitter API 过去曾允许此类参数,但现在不再允许,您只能使用过去 2 或 4 天的数据,具体取决于数据的可用性 - 请注意,日期范围不会出现在该参数列表中致电 (https://dev.twitter.com/docs/api/1.1/get/search/tweets)

如果有帮助,请告诉我。

【讨论】:

    猜你喜欢
    • 2014-08-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-22
    • 1970-01-01
    相关资源
    最近更新 更多