Twitter REST API 中的速率限制 - 需要澄清 [英] Rate Limit in Twitter REST API - a clarification needed

查看:81
本文介绍了Twitter REST API 中的速率限制 - 需要澄清的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 R 访问 Twitter 的 REST API.来自开发者网站(https://dev.twitter.com/docs/rate-limit/1.1/limits) 我知道 twitter 搜索推文的速率限制为每 15 分钟 450 次.

I am using R to access Twitter's REST API. From the developers website(https://dev.twitter.com/docs/rate-limiting/1.1/limits) I understand that twitter has a rate limit of 450 every 15 mins for searching tweets.

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

My question is: What is the rate I reach with the code below: Is it 5 (5 days requested separately) or is it 500 (5 days * 100 tweets) ?

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))
}

推荐答案

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

You are reaching the limit of 180 API calls/15min for the GET search/tweets query: https://dev.twitter.com/docs/api/1.1/get/search/tweets. If you are using the twitteR packages you can check which limit you have reached with

getCurRateLimitInfo()

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

Thought about your question again. It'd be easier to tell you if you gave us the error that R throws at you but I think it might have to do with the dates.

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

The Twitter API used to allow such params but not anymore, you are limited on the past 2 or 4 days of data depending on the availability of the data - Note that the date range does not appear in the list of params for that call (https://dev.twitter.com/docs/api/1.1/get/search/tweets)

如果这有帮助,请告诉我.

Let me know if that helps.

这篇关于Twitter REST API 中的速率限制 - 需要澄清的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆