I previously posted about Google AJAX Search API’s easy of use. It does come at a cost though. The cost is that it is difficult to use the API server side. This is because it is designed to work with javascript from a specific url (including port and directory). This cripples the API for stand alone application and server side developers. I am not omnipresent (yet), but I am sure this was Google’s intent. This way they can make it unpleasant to data mine Google programatically.

On the flip side, making it Javascript lowers the barrier to entry. In order to use the API, a web developer only needs to know one language. I think that was a driving force for introducing the API, but that doesn’t explain Google’s decision to deprecate their soap API.

In some applications it pays to serialize state to the database. What if you want remember what locations users searched for? What if you want to do analysis on users searchs to better focus your site? All of this requires you to do a “Google Ajax” search and then make an “Ajax” call to your site to store any data you need. Tedious, but not a terrible.

What is really terrible is the fact that they call it an “AJAX” search. I think we can all agree that Ajax isn’t an acronym. According to Anne Zelenka, in her 6 myths on Ajax article:

> AJAX is an acronym. It stands for “Asynchronous JavaScript and XML.” Capitalize all the letters or you’ll look like a dork

I really think that google should have known better on this one. As Anne suggests, it might be dorky to be in “the know” on this but, it is inexcusable for Google (Valhalla to us geeks) to miss this one. First off they don’t use XML. And more importantly they use Javascript On Demand instead of XmlHttpRequest to get around cross site scripting issues.

The fact that there are numerous people concerned about the security of this API, is probably a good reason not to draw attention to the fact that it uses “On Demand” techniques. Under the current browser security model, I believe this is the only way you could write a javascript ONLY api that works cross domain. Personally, I am not that concerned about the security aspect of the API, but I think it is a mistake to use the improper AJAX, as opposed the more widely accepted Ajax.

All that being said I still love how easy it integrates with google maps. I guess if you need to do something server side you could always fail-over to Yahoo’s Restful API. I still believe it is a great time to be a web developer with so many companies playing nice with their data, allowing you to make special applications useful at low cost.

Post Information

Tags:

We're Reading

Feeds/Syndication

4 Responses to “Google AJAX Search API (in theory)”

Leave a Reply