Sunday, July 27, 2008

The Google REST Search API

This news is not very recent - about 3 months old - but I think it is of interest:

Google released a REST Search API. Read more about it at the links below:

Google REST Search API news from the Google Blogscoped blog by Philipp Lenssen. (This was where I first read about it.)

The Google page about the REST Search API

The above link is actually an anchor part way down the main page about the Google AJAX Search API, because the REST Search API is a part of the AJAX Search API. From what I could gather from the other links below, and from comments on Philipp's post, it looks like it (the REST API) was available internally for a while before Google released the information about it later - maybe after refactoring it to make it usable separately from AJAXified web pages - because you can use the REST Search API from server-side code and from Flash, according to the docs.

Here are the other links I saw about it:

The comments on Philipp's post above.

A post on the Google AJAX Search API blog, coming some days after Philipp's post (Mark Lucovsky - presumably of Google - says in the comments above that Philipp "scooped" them on this story :-)

(Philipp's blog is a well-known blog with news about Google products and services - it's worth subscribing to.)

Note: while the usage of the REST Search API is via straightforward HTTP requests, the output is in JSON (JavaScript Object Notation) format, so you need a JSON library. Luckily, there are JSON libaries for most popular languages - just go here and scroll down that page some.

This feature (output in JSON format only) differs from the Yahoo Search API (which is also REST-based), in that Yahoo's API can produce output in either JSON or XML. I've used that one, and its pretty good and useful. One reason why Google may have only provided JSON output, is that JSON is more lightweight than XML output, in general. But it might be useful for them to support XML output too, particularly since you can then use XPath-style queries on the returned output. Hope they're considering it.

Vasudev Ram

No comments: