Building a multi-engine search interface in under 25 minutes!

Imagine you want to build an interface to do some serious web research. It would be good to search Google, Yahoo and Bing at the same time and see the results without leaving the site. A few months ago this was a lot of work. Nowadays however, by using YQL and YUI it can be done in an hour - tops.

Check out the final product, which I've called GooHooBi at

GooHooBi - search Google, Yahoo and Bing in one go!

The research mode shows the results in the same interface:

GooHooBi - research mode.

You can see the interface in action in the following screencast:

As explained in the screencast, the driver of GooHooBi is YQL. Instead of fussing about with all the different search APIs, all you have to do is to play with the YQL console and put together the following YQL statement:

select * from query.multi where queries='
select Title,Description,Url,DisplayUrl
from where query="cat";
select title,clickurl,abstract,dispurl
from search.web(20) where query="cat";
select titleNoFormatting,url,content,visibleUrl
from where q="cat"

The query.multi table in YQL allows you to list a few queries that will be executed one after the other on the YQL server. The queries themselves you can click together from different data tables in the console. The last step is to filter down to only what you really need from each of them.

You can try this query in the YQL console and you can see the JSON output.

The rest is pretty standard cURL requests or JSON-P with JavaScript and a bit of interface assembly.

You can check the source code of GooHooBi.

And to prove that anyone can do this, here is a live(!) coding screencast in under 25 minutes that shows you how to assemble the above query and build the JavaScript and the interface:

Building a search mashup with YQL using Google, Yahoo and Bing - live :) from Christian Heilmann on Vimeo.

The source of the code built in this screencast is also on GitHub.

Chris Heilmann (@codepo8)
Yahoo Developer Network