Google Search API?

Don Box's Spoutlet

Syndication

Several people have forwarded me pointers to Google's move from a SOAP-based access mechanism for search to an AJAX-based one.
 
The O'Reilly coverage starts to detail what's going on, but I think there's more here than meets the eye.
 
I spent a few minutes poking around on the Google site everyone is pointing to to see for myself, and I was surprised - a lot actually.
 
I expected to see some JSON formats specified that would let me issue searches from my runtime/platform/language of choice. More or less like their JSON over GDATA API.
 
Unfortunately, what I found was some HTML/Javascript example. Here's the salient code frag:
 
      var searchControl = new GSearchControl();

      // Add in a full set of searchers
      var localSearch = new GlocalSearch();
      searchControl.addSearcher(localSearch);
      searchControl.addSearcher(new GwebSearch());
      searchControl.addSearcher(new GvideoSearch());
      searchControl.addSearcher(new GblogSearch());
      searchControl.addSearcher(new GnewsSearch());

      // Set the Local Search center point
      localSearch.setCenterPoint("New York, NY");

      // tell the searcher to draw itself and tell it where to attach
      searchControl.draw(document.getElementById("searchcontrol"));

      // execute an inital search
      searchControl.execute("VW GTI");
I have no idea how to make this work in my little ASP.NET/C# based app, let alone my Ruby on Rails one.
 
At first I thought that perhaps Google was providing a set of convenience wrappers on top of a format/protocol-based solution.  Alas, when you dereference the required script tag from that example (
http://www.google.com/uds/api?file=uds.js&v=1.0), you get a little Javascript stub that loads the "real" implementation (http://www.google.com/uds/js/uds_compiled.js) which appears to be some obfuscated (or at least compiled) Javascript that I decided was too baroque to try to decipher.
 
In short, no discernable format that you can cons up and/or parse from arbitrary libraries or runtimes.
 
In my mind, this is a significant step backwards.
 
It's one thing to say move from SOAP to POX or even XML to JSON - the former move trades off extensibility in the spirit of YAGNI, and the latter move trades off SGML synergy for a better impedance match to most people's programming languages. 
 
It's another thing entirely to require someone to use a specific language, runtime, and even local API to get at your service.
 
No matter how you define "web service," I don't think this newest offering qualifies.
 
I'm hoping this is just an anomaly and not a trend, lest we all fall back into the world of opaque/closed protocols.
 
Been there, done that.
 

Posted Dec 20 2006, 01:44 PM by don-box

Comments

Lee Feigenbaum wrote re: Google Search API?
on 12-20-2006 3:05 PM
It's more than just the fact that the "AJAX" API is quite opaque to a non-Javascript-engine consumer. The terms of use for the Google AJAX Search API specifically requires:

"""
Your service must import the Google AJAX Search API using an HTML <script> tag...
"""

So to use the Google AJAX API from a Ruby/Rails app or a C# app or even directly via AJAX (i.e. the XMLHttpRequest object) violates Google's terms of use for the service.

Lee
nate wrote re: Google Search API?
on 12-20-2006 3:15 PM
Looks like Google is betting huge on the demise of desktop apps...I can't say I agree at all with their decision. If anything, I see web services and SAS in general moving back to the desktop, not away from it.

Why should I have to do everything half-assed in a browser when I can do 10x more 10x better in a desktop environment without losing the functionality of the web? Well, now google search is one reason but there are other search engines that don't limit me to a javascript engine.
Dean Harding wrote re: Google Search API?
on 12-20-2006 3:35 PM
I think the problem for Google is that the SOAP API (and any data-based API for that matter) is pretty much opening the whole of their business up for anybody to get at for free.

This AJAX API, on the other hand, is much more easily controlled by Google (in fact, the terms state that you can pretty much just use the result as-is - no manipulation allowed).

I don't think it's a GOOD thing, but I think that's the reason for the change.
Dion Almaer wrote re: Google Search API?
on 12-20-2006 5:17 PM
Dims did the work for you:

http://blogs.cocoondev.org/dims/archives/004722.html

"I used Firefox / Live HTTP Headers / TCPMON's proxy support to come up with this snippet."
Dilip wrote re: Google Search API?
on 12-20-2006 5:29 PM

I don't have anything intelligent to say but I have two words for you: "WELCOME BACK!!!!!!"
t3hGoogles wrote re: Google Search API?
on 12-20-2006 6:49 PM
Wanna play with my data?
- APIs to PUT.
- Widgets to GET.

Cordially,
Google
Bill Higgins wrote re: Google Search API?
on 12-20-2006 9:31 PM
"Been there, done that."

Bought the t-shirt?
Dare Obasanjo aka Carnage4Life wrote Widgets Become More Important than APIs for Data Exchange on the Web
on 12-20-2006 10:08 PM
Tom Sioungaris wrote re: Google Search API?
on 12-21-2006 1:47 AM
I totally agree with you Don. It's a bit reminiscent of when CORBA adopted marshal by value and corrupted it's previously purely message based architecture. Google has done the same if not worse with their new AJAX-based search violating what you've been preaching about Services sharing schema and contract, not class. All these dependencies they introduced by forcing you to use a specific language, runtime and local API are against the whole idea of Service oriention and will inevitably have evolution problems in the future. What were they thinking?
Mike Parsons wrote re: Google Search API?
on 12-21-2006 5:21 AM
"It's another thing entirely to require someone to use a specific language, runtime, and even local API to get at your service"

This is priceless Don, coming from one of the people who invented Indigo, which, honestly, to be of any real use requires Windows and the .Net Framework.

I think the point everyone is missing here is that Google at least provides "stuff" that can be consumed by mere mortals. I certainly wouldn't be able to say this about WCF, WPF, etc, etc. To do anything useful in these technologgies, you really do have to be a guru in .Net, C# ,etc, etc.
Jason Dossett wrote re: Google Search API?
on 12-21-2006 5:47 AM
Mike, you understand the difference between consuming services and implementing them, right? Indigo, WCF, WPF, .NET, C#, etc, etc. are all technologies that can be used to implement services (among other things). If I were going to expose them to the outside world for consumption, I'd still expose them as SOAP which would mean lots of people who aren't .NET\C# gurus could consume them from lots of different types of applications. Google's API is a step backwards in that regard. There's no hypocrisy there for Don to claim this.

I believe, like others have said, that this was a business-motivated decision as opposed to a technology-based decision. Google is plugging the hole in their revenue (that they created) by no longer allowing ad-free use of their core income, search.
Paul Mooney wrote Google Wigets
on 12-21-2006 6:58 AM
Google Search API?
In my mind, this is a significant step backwards. - Don Box
The Google AJAX Search...
Ugh!!'s Greymatter Honeypot wrote Google - Bring on AJAX
on 12-21-2006 7:44 AM
Shannon Whitley wrote re: Google Search API?
on 12-21-2006 11:47 AM
There seems to be a very bad trend here, which includes the new JSON interface from del.icio.us. Instead of promoting improvements in AJAX technology, we're developing hacks and workarounds in the form of new interfaces. Why are we changing the transport mechanisms when they work fine? Let's focus on improving javascript to bring it up to an acceptable standard. If you want to control your data, that's okay, but control it through a standard interface.
dbox wrote Google搜索API?
on 12-26-2006 12:35 AM
???????
habib wrote re: Google Search API?
on 02-20-2007 6:17 AM
hi ,
I want to use google search in my websit .
pleaz inform me
habib_lotfi@yahoo.com
thanks
mail@devshots.com wrote re: Google Search API?
on 03-08-2007 8:02 AM
google's hidden private project
see http://devshots.com
portal wrote re: Google Search API?
on 05-11-2007 1:31 AM
this is my app
praca za granicą wrote re: Google Search API?
on 05-15-2007 12:53 PM
thx great jop!
huli wrote re: Google Search API?
on 07-07-2007 7:40 AM
thanks
bahar wrote re: Google Search API?
on 02-03-2008 10:36 PM
hi,
I want to query Google within my C# application.
I don't know this new AJAX-based access mechanism much!
would you please help me?

bahareh.sarrafzadeh@gmail.com

Add a Comment

(required)  
(optional)
(required)  
Remember Me?