views:

506

answers:

4

Does anyone know of a Java library that provides a structured interface to Google's AJAX Search API http://code.google.com/apis/ajaxsearch/?

I could only find Java API's for their old SOAP based interface.

A: 

If Google doesn't provide one (which it doesn't, last time I checked), then don't bother looking since using this type of API probably violates section 5.3 of Google's Terms of Service.

"5.3 You agree not to access (or attempt to access) any of the Services by any means other than through the interface that is provided by Google, unless you have been specifically allowed to do so in a separate agreement with Google. You specifically agree not to access (or attempt to access) any of the Services through any automated means (including use of scripts or web crawlers) and shall ensure that you comply with the instructions set out in any robots.txt file present on the Services."

Asaph
I don' think it violates their TOS, I'm merely looking for a way to perform the query from Java on the server instead of using AJAX to provides access for older and mobile clients.
Jakob Hansen
@Jakob Hansen: As long as you're not *automating* the task on the server-side, you should be okay.
Asaph
A: 

They don't have a specific API but they do have examples of how to interact with the service using a Java JSON library.

Kevin
Thanks for the reply, I've seen the examples, this is how I do it currently. But dealing with JSON is IMHO not so pretty in Java. A good abstracted interface would be neat.
Jakob Hansen
http://json.org/java/Seems pretty easy.
Valentin Rocher
A: 

You can request the JSON and work with it as Java objects via gson.

Piskvor
A: 

I wonder if its too late. But have a look at http://code.google.com/p/google-search-java-sdk/

nabeelmukhtar