The track parameter in the twitter streaming API


#1

Looking at the documentation for the track parameter, I understand how to create a ‘OR’ of keywords (using a comma ,) and a ‘AND’ of keywords (by adding a space). However I do not understand how to create a ‘NOT’ of keywords. Eg. I want to track conversations regarding Mc Donalds. In general I give the keyword ‘Donald’ (I do not want to give ‘Mc Donald’ as the keyword as I may miss some conversations on where only Donalds is mentioned). The issue is i get a lot of tweets on Donald Trump. Something which I do not really care about. The tweet stream is quite heavy and I would like to avoid it.

I tried something like Donald -Trump . But of course that did not work. Is there a way to get this done using the track param?


#2

I’ll be upfront now and let you know that anything related to the keyword ‘Donald’ is going to be flooded with Trump Tweets.

Unfortunately, this standard endpoint does not support negation. More details in this post:
https://twittercommunity.com/t/exclude-tweets-with-certain-words-does-not-work-as-expected/

Depending on your use case, you might want to check out the Search APIs. If you do truly need realtime data, then I suggest you check out the Enterprise Powertrack API and keep your eye on our roadmap.