Adam Green
Twitter API Consultant
adam@140dev.com
781-879-2960
@140dev

Search API: More secret search operators

by Adam Green on November 26, 2013

in Search API

Last week I pointed out the undocumented search operator min_retweets. I’ve been searching tweets about this operator (yes, that is pretty meta) and found two more operators that aren’t in the official docs: min_replies and min_faves. You’ll have to experiment with these to see which are best for different needs. Before we get into the details, you should be aware that as undocumented features there is no guarantee they will continue to be available. I guess that is the true for documented features of the API as well.

Personally, I find min_retweets most useful for identifying influential users. Min_replies also implies influence, but an even better use is finding a group of people who know each other well enough to carry on an extended conversation. You can collect all the replies to a tweet and extract the user names. If this is done repeatedly, you can build up a highly engaged circle of friends. Min_faves implies that the tweets are some of the most informative, even if their authors aren’t that influential.

You can use these operators directly in search.twitter.com:
https://twitter.com/search?q=obama%20min_retweets%3A5&src=typd&f=realtime
https://twitter.com/search?q=obama%20min_replies%3A5&src=typd&f=realtime
https://twitter.com/search?q=obama%20min_faves%3A5&src=typd&f=realtime

There is a trick when you use them with the search API. You have to include the operators as part of the query parameter, not as a separate parameter. To get tweets with “obama” and a minimum of 5 retweets, you set the q parameter to “obama min_retweets:5″. Here is an example in the API Console:
http://140dev.com/twitter-api-console/?method=GET&url=1.1/search/tweets&q=obama%20min_retweets:5&run=1

The complete search API call when using the tmhOAuth.php library is:
$connection->request(‘GET’,
$connection->url(’1.1/search/tweets’),
array( ‘q’ => ‘obama min_retweets:5′));

Leave a Comment

Previous post:

Next post: