Saturday, September 13, 2008

Google's ajax search api

This api is available for quiet a long period of time, but i noticed this api today only. After going through couple of blog posts and search api homepage, i feel like writing a blog entry about this api is really worth. One of the striking thing with this api is, this api can give you an aggregation of various search options available in the google homepage. Its a kind of all in one shot. This api can crawl through web searches of various flavours including * Web * Local search * Video * News * Image * Books * Patents It is very simple to incorporate this ajax search api into the web page. We can call the appropriate javascript method will give you the search result in json. Include the script src url and load the script using google.load("search","1") Create a GSearchControl instance and call the predefined method. searchControl.addSearcher(new GlocalSearch()); // Local search searchControl.addSearcher(new GwebSearch()); // Web search searchControl.addSearcher(new GvideoSearch()); // Video search searchControl.addSearcher(new GblogSearch()); // Blog search searchControl.addSearcher(new GnewsSearch()); // News search searchControl.addSearcher(new GimageSearch()); // Image search searchControl.addSearcher(new GbookSearch()); // Book search GSearchControl can control the draw modes also, it can display search results in Linear mode (GSearchControl.DRAW_MODE_LINEAR) or Tabbed mode (GSearchControl.DRAW_MODE_TABBED) These are some of the exciting features. But still more inside this set of API. Do read the - documentation section in google

No comments: