Twitter – Does the Twitter-API support the ability to search your own home timeline

twittertwitter-api

A few months ago, Erik Michaels-Ober asked for:

Search APIs that can be scoped to a particular user's timeline. For
example, I frequently want to search only the Tweets that appeared
within my own timeline.

On February 12th of this year, @ahsteele asked for a similar feature:

I'd like to specify a Twitter list to search for a specified hash tag.

Searching by a hash tag is easy:
http://search.twitter.com/search?q=%23geocamsu will search all of
Twitter for the #geocamsu hash tag. I'd like to limit that search to a particular list but do not see an option for doing so on their
advanced search page.

Is there something I'm missing that allows for specifying a list?

Finally, if you've made a search query on either Twitter.com or the Twitter iPhone app recently, you might've noticed that Twitter's 'Phoenix Search' is clearly placing tweets from those that you follow near the top of the search results.

My Question:

  • Does the Twitter-API support the ability to search your own home timeline (or any defined list)?

Best Answer

Edit:

Twitter deprecated Twitter API v.1. So this info is also deprecated now. You can access the same api by using the URL https://api.twitter.com/1.1/search/tweets.json. Though this endpoint does not seem to be identical to the previous endpoint outlined before.

See Twiter API documentation for details.

Original Text:

As far as I know Twitter Search API is the best thing we've got as of now. And Twitter Search API supports searching timeline of any user. In fact "Search" text box of Twitter (at the top of Twitter page) uses the search API, so you can experiment using that search box.

For example searching

twitter from:yourusername

shows your tweets with word twitter .

You can use the same query for searching from your timeline, or from any users timeline. An API call identical to the example query would be

http://search.twitter.com/search.json?q=twitter%20from%3Ayourusername

Note that Twitter Search API has some limitations. They are discussed at Twitter Search API Documentation.

For searching tweets from a list, I am not aware of a quick solution. You can always use

https://api.twitter.com/1/lists/members.json?slug=listname&owner_screen_name=yourusername

to get list members and construct a query manually by using the OR keyword as:

http://search.twitter.com/search.json?q=twitter%20from%3Auser1%20OR%20from%3Auser2