Rate Limit in Twitter REST API - a clarification needed

给你一囗甜甜゛ 提交于 2019-12-12 06:31:20

问题


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.

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

回答1:


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

EDIT:

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.

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.



来源:https://stackoverflow.com/questions/23267464/rate-limit-in-twitter-rest-api-a-clarification-needed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!