Error n tweets were requested but the API can only return 0
Solution 1
From the official Twitter Search API documentation
https://dev.twitter.com/rest/public/search
The Twitter Search API searches against a sampling of recent Tweets published in the past 7 days.
so you can't search the API for tweets from 2013 - 2014
Solution 2
I also received this message when I was attempting to use the twitteR package to search Twitter-which brought me to this post. However, when I used the search_twitter_and_store command in the same package I was able to retrieve 1702 messages and store them in MySQL. Not exactly what I was shooting for but it did allow me to get and manipulate the data. Might work for you too.
TSR
Updated on June 14, 2022Comments
-
TSR almost 2 years
I am unable to retrieve any tweets using twitteR package in R. For example this request:
nbahash_tweets = searchTwitter("#nba",since='2013-01-01', until='2014-02-25',n=20)
Shows me this warning message:
Warning message: In doRppAPICall("search/tweets", n, params = params, retryOnRateLimit = retryOnRateLimit, : 20 tweets were requested but the API can only return 0
What could be the reason of the problem?