< Day Day Up > |
9.4. Using Your Google API KeyEvery 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 whether 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 book, 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 hack 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 would plug my made-up key into the Perl script as follows: ...
# Your Google API developer's key.
my $google_key='
12BuCK13mY5h0E/34KN0cK@ttH3Do0R
';
... |
< Day Day Up > |