views:

2285

answers:

2

I've had a look at code.google.com, but I didn't find anywhere how to programatically make a search query to Google and get the results. Do you happen to know if this is possible, using some web services or any other way?

Of course, there's always the possibility to send a search query, get the HTML content of the result page and parse it, but I'd like to avoid such trouble, if possible.

A: 

This is possible trough the Google AJAX Search API.

Tomalak
I had dismissed it because i do not want to publish the results but process them programatically. But after some more reading that seems possible with that REST/JSON stuff; I'll have to look this into details. Thx.
Antoine
Yes, the text on the front page is somehow not very promising from a developer's point of view, but I am sure you will get what you need.
Tomalak
Google's TOS explicitly forbids automated/programmatic use of the Ajax API in non-end user applications.
Chris S
@Chris: What makes you assume that this is not for an "end-user application"? The question makes no indication in either direction, and using the AJAX API *not* programmatically is somewhat hard, isn't it? Downvoting this because of possible violation of some TOS is a little like fining a car maker because some of the customers *could* be driving too fast some day.
Tomalak
+2  A: 

Google has had a remarkable history and somewhat . bumpy evolution of its search API There have also been some attempts by third parties to appropriate the content.

It may be worth it to you to do a quick background check on where Google has been, and where it is now regarding its search API (via the links above). Different people have viewpoints on how much better Google search API is over just personal-web-scraping (the option you appear to want to avoid).

It may also be worth re-emphasizing that Google is not the only game in town.

dreftymac
Thx for the details, and i'll have a look at yahoo API if it's easier to use.
Antoine