zthomas.nc zthomas.nc - 1 year ago 142
R Question

searchTwitter() R function not working as expected

I'm trying to pull in tweets that feature the words "Deacs" and "basketball" for the time range 11/15/15 - 11/30/15.

As the below Twitter website search reveals, such tweets certainly exist:

I have set up the TwitteR package on my environment and have successfully pulled in 1000+ tweets in the past for a call. However, when I run the following code:

Dtweets1 <- searchTwitter('deacs+basketball', n = 10, since = '2015-11-15', until = '2015-11-30')

I get the following error, and a List of 0:

Warning message:

In doRppAPICall("search/tweets", n, params = params, retryOnRateLimit = retryOnRateLimit, : 10 tweets were requested but the API can only return 0

Is there a particular reason this error is popping up?

Pj_ Pj_
Answer Source

It has nothing to do with the way you are fetching the data.

Actually, the Twitter Search API only returns a sample of results, not the comprehensive search.

For better results, you can use Twitter Stream API, create a database of the search results, continuously update them.

Worked pretty well for me.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download