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
Now I can write programs to generate Google-whacks!
Other than being a really cool idea, this is a great tactical move from Google. On the one hand, by restricting the number of queries made to Google, they ensure that their APIs aren't misused/compromised, it also gives companies an initiative to purchase Google products and deploy this API (probably an unrestricted-query API) on their own network. Furthermore, an API such as this will easily muscle out any sniff of a competition from other search engine wannabes. Google has managed to do all this and yet be as compliant
to an Open Source initiative as possible. Remarkable.
"To access the Google Web APIs service, you must create a Google Account and obtain a license key"
Gee, and now Google will log every search from your automated application.
"...The initial service available with your Google Account is:
Google Web APIs - a tool for software developers to automatically query Google
In the future, your Google account will provide access to all Google programs requiring sign in including: Google Groups, Google AdWords, Google Store, Google in Your Language program...."
Does that mean that accessing the Google Groups is now going to need me to create an account? Hmm..
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 = ""
],
...
Won't work, evil doers!!
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
No Automated Querying
You may not send automated queries of any sort to Google's system without express permission in advance from Google. Note that "sending automated queries" includes, among other things:
- using any software which sends queries to Google to determine how a website or webpage "ranks" on Google for various queries;
- "meta-searching" Google; and
- performing "offline" searches on Google.
Now, how can I use the web API?!Note that this is not in the Google Api TOS wich you must agree to before downloading the api. But in the Google Terms of Service wich you must agree to before creating a Google account needed to use the Google Api.
Still, it's fun and i'll play with it!
Here's a copy of the write up. My machine barely made it to the site :)
Google is just the juice
Thu, Apr 11, 2002; by Dave Winer.
Good afternoon
A very quick piece today, a story, a question, an answer and a pointer.
The story -- 1995. A new release of Netscape. Can't get through to their servers. This thing is exploding. A mind bomb every minute. Wow. I love this. End of story.
The question: Can it happen again?
The answer..
Yes!
This afternoon Google opened a public SOAP 1.1 interface.
Now, from scripts, we can call Google as if it were a script running locally.
What comes back? Data.
What questions should we ask?
That's where the mind bombs will come from.
In the loop
We've been in the loop with Google, privately, for the last few weeks, so we've had a chance to play with ideas and actually have some.
Yesterday, as a tease, I put a Google Box on Weblogs.Com. Every hour it recalcs, showing the top 10 hits on Google for the term weblog. To my surprise, it changes, it's not constant. And it took me to places I didn't know about. The serendipity of queries that run for a long time. That, imho, is where the juice is in the Google API; and probably many or most of the APIs that are sure to follow; because Google is so popular.
Google hits the ball over the net, then we return the volley. Finally, once again, signs of life. Let's hope we learn from the past -- and keep the spark going -- welcoming competition and learning from it instead of snuffing it out. The intoxication of a new idea every day is too good to not want to be there once again.
Maybe the dark ages are over? I hope so.
Google is just the juice
It's happening in real time. As I write this I'm waiting for the embargo to lift. As soon as that happens, we'll start releasing new parts and samples for Radio and Frontier users that connect to Google's SOAP interface, with simple but geekish instructions for getting started.
Later today Google Boxes will start showing up on Radio weblogs, which you can follow through Weblogs.Com. You'll see SOAP developers, on all platforms, getting to work, creating and publishing the glue that turns the Internet, finally, into a fantastic scripting environment. Google is just the juice we need.
Dave Winer
Whilst the potential of a regular Google search is large enough, when you consider the Google search modifiers, the potential becomes staggering. Imagine using the following features:
Does anyone happen to know if you can use the other sections of Google (e.g. news, images etc.)?
Is Google the best company ever or what?!
Well,
I know what I'll be doing when I get to work today. Just my additional 2 cents to this marvelous addition to Google.
I wanna program some pigeons!
how this is different than using a script to parse Google's output?
White Hat Research.net
Geek Clothes - Including a shirt with the (in)famous Ben Franklin quote!
I think I speak for most when I ask if you can have your results back in the "interesting" language sets:
I get the following when I load that URL:
/0100012/stories/2002/04/1 was not found on this server.
-----
Not Found
The requested URL
-----
Did you drop something out of that URL, or did it lose something when it got posted?
Aww, FSCK!
Come to the University of Mars! Classes starting soon!
If they are going to limit you to only 1000 queries, I fail to see the point. It wouldn't be hard at all to write a simple API on your own to, say, a c++ class that spits out the necessary url's [like http://www.google.com/search?hl=en&q=example]
or the like, dispatch them to google port 80, and then parse the results into easily program readable data sets/results? A third party could write this sort of thing easily enough if there was demand for it. I mean, esentially the google search API isn't going to be offering anything not available in the standard forms, is it? Except their spell checker, I believe. [Which you could use via html too, actually, "Did you mean: ______" ]
---
the pen is mightier than the sword, the sword is mightier than the court, the court is mightier than the pen.
How long until slashdot offers this service?
ok then your [sic] infringing on my copyright! Could you as [sic] me next time before STEALING my comments for your own?
It's not something you have to go to google for, but it'd be nice
The 1000 searches a day is very nice....I know I would never need that many (if results were unlimited anyway).
HOWEVER...you only get 10 results per search??
... sort of.. they have a XML file out there off of the main site that you can query to get the latest headlines...
i've actually used it before with a simple VB app...
email me if you want the code...
I lost my concept of community when my community lost all concept of me.
It does. Haven't you read einstein?
I would love a computer-friendly way to access postings. The limited UI offered by a web browser is not the right way to read these huge, nested discussions! I've been playing with better interfaces, and have kludgey code for parsing slashdot HTML pages, but it would be wonderful to have something cleaner and less brittle.
Anyone else feels that if google ever dissapears, they will become very unproductive?
[alk]
FYI:
We like them Monday, Wednesday, and Friday.
We love them Tuesday, Thursday, and Saturday.
And we alternate Sundays.
Get with the program.
--
---
ok then your [sic] infringing on my copyright! Could you as [sic] me next time before STEALING my comments for your own?
It must have most something when posted. Sonmebody posted the "correct" url in a reply, but it looks exactly the same as my post with the space between the 1s
*shrug*
And don't forget to fix the multipart merger.
Ummmmm. Ok, check this out.
/. we have an article about Google releasing their SOAP 1.1 API followed immediately by an article from a guy that set up a spambot trap on his web site, and in the margin a poll about giving spammers what they deserve. Putting 2 and 2 and 2 together, I got 4, popped open a google box and started playing.
This morning on
All I did was ask google to search for "mailto" and "@msn.com" and lo and behold, she spit back 111,000 hits - hits that contain what look like legit email addresses IN THE THREE LINE SUMMARIES.
The point is, now that google can be automated, what's to stop spammers from SOAPing their way into Google to do their harvesting? Would there be any point over what they're doing now? It might be cheaper, because you only have to run over the google results not the whole sites and since Google caches pages, you can even grab addresses from the past, somewhat.
IT ALSO DEFEATS SPAMBOT TRAPS.
Doesn't this give spammers whole new avenues to exploit?
Worse, are webmasters going to have to put a halt to Google crawls?
"Lawyers are for sucks."
- Doug McKenzie
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/
PyGoogle allows you to access the web API from Python. Download here. Python has no SOAP support in the standard library, but a working SOAP library is included with PyGoogle.
-Mark
Dive Into Python - a free Python book for experienced programmers
It seems there is still time to enter the Google Programming Contest and although I have neither the time nor the skill to do it, I do have an interesting idea if someone else wants to take a shot at it.
Years ago, The Hollywood Stock Exchange was a somewhat popular game (maybe it still is, but it doesn't really interest me). The general idea being that you could "Buy shares of your favorite actors, movies, and music artists and watch their values rise or fall based on the success of their careers and personal life."
It would be interesting to see a similar game based on the popularity of queries. It's clear from the Google Zeitgeist that certain search terms do gain and lose popularity on a regular basis, and for someone tapped in to mainstream culture, it may not be too hard to predict.
I suppose you could do the same thing with the other info there (Browsers, OSs, Current Events, etc.) but I don't think it would be as interesting. Although... Anime searches might be neat.
Anyhow, just an idea I'd love to see someone run with.
-Tommy
"I got a half gallon of Jack, and 2 dozen Ant Traps. I'm about to get wild." -me
Google is singular. Even though the term represents an organization of many people, it is just one organization, and so the word is singular. You don't say, "The class have learned the material from lesson 5"; you say, "The class has learned the material from lesson 5."
Trust me on this one. It's not like the word "data" where we monkeyed around and changed the semantics.
So it's not, "Google Release Web APIs," it's "Google Releases Web APIs"; and it's not "Google have released ... ," it's "Google has released ... ." I know, it doesn't matter. That doesn't keep it from bothering me.
Secession is the right of all sentient beings.
Maybe now Kuro5hin can redo their Interactive Sucks-Rules-O-Meter.
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?
Huh? What does this API have to do with being crawled by google? 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.
The Google Rights include rights to the following:......(3) the search results and spell checking you obtain when you use Google Web APIs.
I never thought I'd read the words "Google Rights" in a legal document, but anyway, how can Google own the rights to "spell checking".. what exactly do they own? The words that come back? The association of misspelled words to spelled words? How could you abuse that??
I must say this is incredibly cool though.. however I would much rather see a generic "Search Engine API" that isn't owned by Google, and can be implemented by anyone.
Recall that the first indication of this API's existence
was from comp.lang.ruby. I suspect that the
first implementation was in Ruby as well.
You can find the Ruby version at:
http://www.caliban.org/ruby/
Notice how Google avoided use of CORBA for these APIs. That speaks volumes in favour of SOAP's robustness over CORBA knowing how these Google dudes are perfectionists.
Why is this needed? I've been using Google programatically for a while now. What does this offer that I can't use on my own?
So Google is deploying a SOAP interface to a very large scale system. Anybody know what kind of software they have supporting this? Is it a custom engine? SOAP4J? Heaven forbid, not ASP.NET!
To apply slashdot effect to Google?
So, you can execute 1,000 searches a day through their API, OR you can code your program to do a normal google search and parse the results out of the returned html (like people have had to do until now)...
How many projects can't afford the overhead of a little html parsing but CAN afford to be limited to 1,000 searches/day? I'm sure they'll offer higher limits for a fee, but I think the DIY-html-parsing google "api" is going to keep on working just fine (and for free).
__
Choose mnemonic identifiers. If you can't remember what mnemonic means, you've got a problem. - Larry Wall
Does anyone know of any consumer retail sites that have a similar api to their online catalogs?
I am a grad student looking to avoid html scrapping for one of my projects.
Thanks
http://gondolin.hist.liv.ac.uk/~cheshire/tclgoogle . tml
Enjoy!
-- Azaroth
Sorry, I don't remember hating Google.
-- Give him Head? Be a Beacon? :P)
(If you can't figure out how to E-Mail me, Don't.
Tyler Durden. Tyler Durden.
So, yeah, they're definitely interested in it if the developer community is interested in it.
Proud to be / Smiley-free / Since Nineteen / Ninety-Three
Also, the limit on results per query severely limits the usefulness of this API.
Finally, the requirement for a license key sounds a little Microsoftish to me. Since Google is not Microsoft, this is unlikely to work in their favor.
For these reasons, I suspect that the release of this API may hurt Google more than it helps them.
The only way the typical /.er can pick up a chick is with a forklift. -- AC
Does reading Userland make you want to vomit?
Maybe some day.
:wq
Google would rather you use their bandwidth and download their textads, than have a computer suck out the results with no branding. Easy.
mogorific carpentry experiments
Simple but interesting use for Google API - GoogleMail
email google@capeclear.com with your query text as the 'Subject:'
Useful for:
- wireless devices
- access google from Outlook / elm
- remind yourself to do something on the Internet
Try it google@capeclear.com
Ed