Use JavaScript Now to Access Many Google APIs

JavaScript has been one of the most talked languages this year. It rules not only on the client-side, but has also made significant inroads into server side architectures, especially if you consider the mind share that Node.js received this year. It will not be a surprise if API vendors put a JavaScript API on top of their list next year as part of their client libraries. Google, whose APIs are among the most integrated, has made a jump on the trend and released an Alpha version of its JavaScript client Library for Google APIs.

The JavaScript Client Library was announced at the Google Code blog and the focus is clearly on not just making it easier for developers to use the Google APIs, but also addressing a missing part in the client libraries. For a while now, client libraries were provided in various programming languages like Java, PHP and Python but with the browser is getting powerful and JavaScript going mainstream. Releasing the JavaScript Client Library was simply the next logical step for Google.

The library gives access to all APIs listed in the Google API Explorer and supports multiple browser environments and OAuth 2.0. To use the library, you will need to get have a developer key for the API that you wish to use. This can be obtained from the Google APIs console.

The Project home page for the library provides a Getting Started guide, Reference Documentation and Samples. The Getting started guide contains a straightforward example demonstrating the usage of the API. You simply need to load the library for the Google API that you plan to use, provide your key and make the client requests to the respective endpoints. A Callback in your request will be invoked with the results of the request. The Google Apps Blog has a post where they have demonstrated how to use the library to access the Google Calendar API.

The Javascript Client library is a great step forward and opens up the Google APIs to a much larger segment of developers who are more comfortable with traditional Front-end languages rather than a high level programming languages. It could eliminate the need for server side code in several cases.  The library is currently in alpha, so expect changes to happen. The JavaScript Client User Group should be a good group to be a part of to keep updated on its development.

The ProgrammableWeb directory lists 93 Google APIs and 287 JavaScript APIs.