How to Load Google API
A Google Application Programmable Interface (API) allows you to embed Google applications directly into your website. The first step your website must take to use a Google API is to load the API using the API Loader. The API Loader is specific JavaScript code in the header of your document and additional code in the body of your document where you want the Google application to appear. Available APIs that use the loader include Blog Search, Book Search, Earth, Feed, Friend Connect, gData, Image Search, Language, Maps, News Search, Orkut, Patent Search, Picker, Video Search and Visualization.
Instructions
-
-
1
Go to Google Loader and click the “Sign up for an API Key” link in the left menu. Enter your website URL in the text box and click the “Generate API Key” button. Your Google API key is a long string of letters and numbers. Locate the key in the “Your key is” box at the top of the sign-up page. Copy and paste the key into a text document named "Google API Key" and save it on your computer.
-
2
Enter the following code into the header (<head></head>) of your Web page. Replace "INSERT-YOUR-KEY" with your Google API key.
<script type="text/javascript" src="https://www.google.com/jsapi?key=INSERT-YOUR-KEY"></script>
-
-
3
Enter the following code on your page where you want it to load the Google API. Replace the module with the module name and the version with the module version.
<script type="text/javascript">
google.load("module", "version");
</script>Example:
To load Google Feeds API, replace “module” with “feeds” and version with "1," according to the Available APIs list.
<script type="text/javascript">
google.load("feeds", "1");
</script>
-
1
Tips & Warnings
Additional information and demonstrations on how to use each API are available in the Google Code Playground.