Get tweets with a specific hashtag, from any user

rest
streaming
search

#1

Hi,
I need to find all the tweets with a certain hashtag, from any user (not just the ones that are connected to the app). I only need to to track 1 hashtag that will not be too popular. Which API and endpoint is the one I need? I checked the followings:

REST: search/tweets
https://dev.twitter.com/rest/reference/get/search/tweets
This seems good but the doc says “Not all Tweets will be indexed or made available via the search interface”. So thats not good then.

Streaming: Public: statuses/filter


This one seems good too but the doc says “allows up to 400 track keywords, 5,000 follow userids”. I don’t know which users will tweet those tags, so I don’t know which 5000 users do I need to follow.

Streaming: firehose
https://dev.twitter.com/streaming/reference/get/statuses/firehose
I guess this has it all but it seems like an overkill for my app, I just want to search for 1 single tag that will be tweeted rarely. The doc says “Few applications require this level of access” and “This endpoint requires special permission to access”.

So the questions at the end are:

  • What is NOT included in the REST API?
  • Which service gives me those tweets (maybe non of the above)?

Thanks


#2

The correct endpoint would be the filter endpoint on the public Streaming API. You do not need to include any follow userid parameters, just the keyword you wish to track.


#3

Thanks!


#4

Could you give an example?


Collecting Tweets for a ceratin keyword
#5

@TonyLancer12: I wrote a short guide to doing so for the python-twitter library, from which you could probably glean the basics:

https://iseverythingstilltheworst.com/blog/2016/05/28/capturing_twitter_streams/