Pregunta

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))
}
¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top