Retrieve twitter old tweet using R

3.6k views Asked by At

To make it simple, I manage to retrieve tweet in R using twitteR library. The specific code is:

List <- searchTwitter('searchterm', n=1000)

The problem is my search term aren't really popular because it's a local brand and people in this region using twitter less than before. Most of the tweets are came from 2013 to 2015 while today I can only retrieve 12 tweets within the range of latest week.

Is there anyway for me to retrieve old tweet, at least around 200 latest tweets without considering the date?

1

There are 1 answers

3
Oliver Frost On BEST ANSWER

You can only get tweets from the last 6-9 days with the REST API. You will probably have to find a solution where you can iterate through Twitter accounts that you know that have tweeted about the company before and pull their timelines. You can do:

List <- userTimeline("Username", n = 2000)

And then convert the list to a data frame:

Df <- twListToDF(List)

You can also iterate through each of those users' followers and see if they have tweeted anything similar, and keep an eye on the call limit. But the REST API is fairly limited in what you can pull back for general tweets (without pulling an entire user's timeline.)