Easily access Google APIs from Java

The Google API Client Library for Java provides functionality common to all Google APIs, for example HTTP transport, error handling, authentication, JSON parsing, media download/upload, and batching. The library includes a powerful OAuth 2.0 library with a consistent interface; lightweight, efficient XML and JSON data models that support any data schema; and support for protocol buffers.

To call a Google API using Google's client libraries for Java, you need the generated Java library for the Google API you are accessing. These generated libraries include the core google-api-java-client library along with API-specific information such as the root URL. They also include classes that represent entities in the context of the API, and that are useful for making conversions between JSON objects and Java objects.

Beta features

Features marked with @Beta at the class or method level are subject to change. They might be modified or removed in any major release. Do not use beta features if your code is a library itself (that is, if your code is used on the CLASSPATH of users outside your control).

Deprecated features

Deprecated non-beta features will be removed eighteen months after the release in which they are first deprecated. You must fix your usages before this time. If you don't, any type of breakage might result, and you are not guaranteed a compilation error.

Highlights of the Google API Client Library for Java

It's simple to call Google APIs

You can call Google APIs using Google service-specific generated libraries with the Google API Client Library for Java. (To find the generated client library for a Google API, visit the list of supported Google APIs.) Here's an example that uses the Calendar API Client Library for Java to make a call to the Google Calendar API:

Installation is easy

If you are not using a generated library, you can download the binary for the Google API Client Library for Java directly from the downloads page, or you can use Maven or Gradle. To use Maven, add the following lines to your pom.xml file:

Supported environments

Android 4.0 or higher—but if a Google Play Services library is available for the Google service you need, use that library instead of this one. The Google Play library will give you the best possible performance and experience.