Search code examples
twittertwitter4jtwitter-streaming-apitwitter-search

How to get the old timeline or tweet?


i'm University students of South korea I'm developing analysis application using bigdata of twitter with my advisor professor. So i'm gathering tweets contains specific keyword(relevant word of crime) at period. I use 'streaming api' and 'search api' now. I have seen that using search api and streaming api result is return tweets of only one week.

I should be get the old data that have keyword of crime and since 2006 until 2016

do you have any idea?


Solution

  • Sadly you can't get tweets from that time range. From the documentation:

    The Search API is not complete index of all Tweets, but instead an index of recent Tweets. At the moment that index includes between 6-9 days of Tweets.

    So, you can only get recent tweets from the search API. Be careful too with the data beacuse it's about relevance not completeness, from the same documentation:

    Before getting involved, it’s important to know that the Search API is focused on relevance and not completeness. This means that some Tweets and users may be missing from search results. If you want to match for completeness you should consider using a Streaming API instead.

    If you really need older tweets you will have to get them from other sources like Gnip. Otherwise you will have to approach differently your problem.

    If you have the names (or id's) of all the users that you want to get info you could get the timelines from each user getting up to 3200 tweets.