Using the Key in a Tip

Every time you send a request to the Google server in a program, you have to send your key along with it. Google checks the key and determines if it's valid, and you're still within your daily 1,000 query limit; if so, Google processes the request.

All the programs in this tutorial, regardless of language and platform, provide a place to plug in your key. The key itself is just a string of random-looking characters (e.g., 12BuCK13mY5h0E/34KN0cK@ttH3Do0R).

A Perl tip usually includes a line like the following:

...
# Your Google API developer's key my $google_key='insert key here';
...

The Java GoogleAPIDemo included in the Google Web APIs Developer's Kit is invoked on the command line like so:

% java -cp googleapi.jar com.google.soap.search.GoogleAPIDemo  
insert_key_here  search ostrich

In both cases, insert key here or insert_key_here should be substituted with your own Google Web API key. For example, I'd plug my made-up key into the Perl script as follows:

...
# Your Google API developer's key my $google_key='12BuCK13mY5h0E/34KN0cK@ttH3Do0R';
...