Google Releases Web APIs
skunkeh writes "Google have released the first beta of their Web APIs package. Used in conjunction with a free license key this SOAP based web service allows developers to execute up to 1000 automated queries a day, but is currently available for non-commercial use only. The download comes with Java and .NET code examples and includes a WSDL description for use with other SOAP supporting languages." There's also a write up about uses on Userland.
http://www.soapware.org/directory/4/services/googl eApi/implementations
At the time of posting languages catered for were for AppleScript, Frontier/Radio, Perl, Python and Visual Basic. I've written a basic implementation in PHP which has yet to be added to the list - you can find it here:
http://toys.incutio.com/php/php-google-web-api.htm l
This is a very cool toy.
The old one here - "Google to Offer API"
Don't quote me on this.
http://radio.weblogs.com/0100012/stories/2002/04/1 1/applescriptForGoogleApi.html
has some Applescript for your use
I just had a go with this and some example output is displayed below. Basically you can do a search of their main web pages, request a cached page or use their spellchecker.
n d_Culture/History"}
e mpire.htm" ... "
Dave
$ java -cp googleapi.jar com.google.soap.search.GoogleAPIDemo XXmykeyXX search "british empire"
Parameters:
Client key = XXmykeyXX
Directive = search
Args = british empire
Google Search Results:
======================
{
TM = 0.117071
Q = "british empire"
CT = ""
TT = ""
CATs =
{
{SE="", FVN="Top/Regional/Europe/United_Kingdom/Society_a
}
Start Index = 1
End Index = 10
Estimated Total Results Number = 688000
Document Filtering = true
Estimate Correct = false
Rs =
{
[
URL = "http://www.btinternet.com/~britishempire/empire/
Title = "The British Empire"
Snippet = "| Introduction | Articles | Biographies | Timelines
| Discussio
n | Map Room | Armed Forces | Art
Directory Category = {SE="", FVN=""}
Directory Title = ""
Summary = ""
Cached Size = "5k"
Related information present = true
Host Name = ""
],
...
O'Reilly has a good article here with some code as well in both Java and Perl.
http://www.oreillynet.com/cs/weblog/view/wlg/1283
Well this is what it told me:
In the future, your Google account will enable login access to all Google services, including Google Groups posting, Google AdWords, the Google Store, the Google in Your Language program, and more.
(My emphasis)
Notice the difference?
Does anyone happen to know if you can use the other sections of Google (e.g. news, images etc.)?
From the FAQ:
Can Google APIs be used to access Google Groups? Image search? Directory search?
No. The Google Web APIs service can only be used to search Google's main index of 2 billion Web pages.
--
I just submitted a request to have Ruby/Google added to the list of implementations. Until then you can find it at http://www.caliban.org/ruby/
LOL maybe we should just dismantle the whole internet, as clearly the internet is the channel used by spammers! Oh wait. The internet has many many positive uses. Gee!
</sarcasm>
LOL a 4 for Interesting? Oh come on, this is ignorance, not information.
Horrors! Spammers can use this!
Uh 'scuse me but I can write a 10 line perl script that does the same thing. All I have to do is craft a query to google, and put a bunch of work into parsing out the real content from the HTML that comes back. Kind of a pain, but nothing a few regexp can't handle. This API is nothing new, it's just something handy. I'm seriously thinking I can replace a component of a research project here at our research facility with this. Why reinvent the wheel after all?
Worse, are webmasters going to have to put a halt to Google crawls?
It's called robots.txt. Ever run a web server? All this API does is let you do searches to google. Google is google is always searching. That's what robots.txt is for. You are not going to get crawled by this! This is not a BOT, just a QUERY TOOL.
OK, your script parses Google's HTML output today, but what about a year from now when Google changes its output, to say, XHTML or plain text or something. How well will your script work then? Although the Google API could change tommorow like some companies' , in general APIs are more stable. I haven't looked at their API, but I'm guessing it's also easier to develop against their API, and it should be less processor- and network-intensive.
True. Plural usage of a company name is correct in British English.
Ian Macdonald, Linux sysadmin & Ruby hacker