Twitter – Retrieve old hashtagged tweets on Twitter from various users

twittertwitter-api

I need to retrieve an archive or a list of tweets up to a year old, that were posted by various users, and included specific hashtags. A long search on Google created the notion this is impossible even with using the Twitter API. We have a programmer on the team that can create anything needed with the API, I just need a lead or a tip on whether this is impossible.

Best Answer

It actually depends on the amount of tweets with that hashtag. If the amount is really less, it might be possible. Twitter documentation mentions that -

Clients may access a theoretical maximum of 3,200 statuses via the page and count parameters for the user_timeline REST API methods. Other timeline methods have a theoretical maximum of 800 statuses. Requests for more than the limit will result in a reply with a status code of 200 and an empty result in the format requested. Twitter still maintains a database of all the tweets sent by a user. However, to ensure performance of the site, this artificial limit is temporarily in place.

Add to that, the search API's page parameters says -

The page number (starting at 1) to return, up to a max of roughly 1500 results (based on rpp * page).

So that would mean that Twitter doesn't intend to give back All the data it consumed. It'll hold back some. In that case, you cannot do anything, unless you find a third party service that indexes tweets.

The best bet if to try searching combining the since_id, rpp and until parameters and see how far you can go.