1

I'm using the Twitter streaming API. It works wonderfully for single words, but seemingly cannot filter by an exact bigram (two word string).

I'm testing this by searching for common words, that are commonly in combination:

e.g. "feel good"

This is the URL: (will require OAuth login):

https://stream.twitter.com/1.1/statuses/filter.json?track=keywords_go_here

Things that don't work:

track=feel%20good ==> still produces: "text":"Feels so good outside!..."
track=%27feel%20good%27 ==> produces nothing
track=feel%20good, ==> still produces "good that my friend has an ED too because I can feel..."

Any ideas on getting this to work?

edit: someone sort-of answered this in early 2010: Twitter Streaming API - tracking exact multiple keywords in exact order , but are there any updates on this issue?

Community
  • 1
  • 1
LittleBobbyTables
  • 4,361
  • 9
  • 38
  • 67

2 Answers2

0

It seems like you can do that search according to the api: https://dev.twitter.com/docs/using-search

"happy hour" containing the exact phrase "happy hour"

Just need to put your phrase in quotation

cubbuk
  • 7,800
  • 4
  • 35
  • 62
0

I am sorry, but the answer is

Exact matching of phrases (equivalent to quoted phrases in most search engines) is not supported.

Furthermore,

Punctuation and special characters will be considered part of the term they are adjacent to.

So if you track "feel good", you will get messages such as

He said, "feel it", and I replied, "I am good".

If you want exact matches, then you have two options:

A) track both terms and then discard all tweets that don't have exact matches, or

B) get a paid subscription to the Twitter firehose with Gnip or DataSift. Twitter makes a living out of things like this, so I don't think it's ever gonna be available on the Streaming API.

e18r
  • 7,578
  • 4
  • 45
  • 40