Recipe 27.1 Getting Set Up with Google's Web API
You want to use Google's
Web API to make Java-enabled searches of Google's
vast web index.
Download the Google Web APIs SDK. Create a Google account and get a
license key that allows the use of Google's Web API.
Google Web APIs SDK includes an archive
named google.jar. This file contains the classes
that your program will use to connect with Google during searches.
Here are the specific steps you take to prepare the web application
for connecting with Google:
Download the zipped SDK from http://www.google.com/apis/download.html.
Unpack this file into a directory (named
googleapi in Beta Version 3.0 of the Google Web
APIs). This directory contains google.jar, along
with a lot of code samples and documentation.
Create a Google account and get a license key, which is encoded text
that looks like
Your Java code uses this key when it queries
Google's index. The query will fail if it is not
accompanied by a valid key.
Place the google.jar file in the
WEB-INF/lib directory of the web application.
Develop your Java classes for connecting with Google, using the
com.google.soap.search package from the
The home for the Google Web APIs: http://www.google.com/apis/; the Google web
APIs SDK: http://www.google.com/apis/download.html.