Client Libraries Explained

While you can use Google Cloud APIs by making direct HTTP requests to the server (or RPC calls where available), we provide client library code for all our Cloud APIs that makes it easier to access them from your favorite languages. This document explains the different types of client libraries we provide for Cloud APIs. You can find out more about the available libraries for your product or language of choice in the product or language’s documentation.

Google Cloud Client Libraries

Google Cloud Client Libraries use our latest client library model and are our recommended option for accessing Cloud APIs programmatically, where available. Cloud Client Libraries:

  • Provide idiomatic, generated or hand-written code in each language, making the Cloud API simple and intuitive to use.
  • Handle all the low-level details of communication with the server, including authenticating with Google.
  • Can be installed using familiar package management tools such as npm and pip.

You can find installation instructions and reference material for the appropriate Cloud Client Library on your chosen Cloud API’s Client Libraries page.

For almost all our supported languages, you can also download a single client library that provides an interface to all supported Cloud APIs. You can find links to get started with these and their reference documentation on our Cloud Client Libraries page.

gRPC-enabled libraries

A growing number of Cloud Client Libraries use gRPC “under the hood” to communicate with Google’s servers. gRPC is a language-neutral, platform-neutral, open source, remote procedure call (RPC) system initially developed at Google: you can find out much more about it at

Google’s gRPC-enabled APIs generally have both REST and RPC interfaces, so rather than using JSON over HTTP to talk to the REST interface, gRPC-enabled APIs use protocol buffers and gRPC over HTTP2 to talk to the RPC interface. This is significantly more efficient in terms of throughput and CPU usage — accessing an API using gRPC can increase throughput per CPU by as much as a factor of 10 compared to the JSON REST API.

You can find out if a Cloud Client Library is gRPC-enabled on the relevant product’s Client Libraries page.

If there isn’t a gRPC-enabled client library for your favorite language and you’re interested in using gRPC, you have the following options:

  • Use the existing Google Cloud Client Library, if available. We plan to upgrade as many Cloud Client Libraries as possible to gRPC, and the existing library will have the same interface so switching will be simple when the gRPC version becomes available. In the meantime, you’ll still get all the other advantages of our client library code.
  • If the API itself is gRPC-enabled (in other words, if there are gRPC-enabled clients for other languages), you can generate your own low-level gRPC client code for it in any of gRPC’s supported languages. To do this, you’ll need the API’s protocol buffers service definition (typically available from our repository on Github ). You can then follow the instructions for your preferred language on to generate and use your client.

Google API client libraries

A number of Google Cloud APIs do not yet have Google Cloud Client Libraries available in all languages. If you want to use one of these APIs and there is no Cloud Client Library for your preferred language, you can still use an older version of our client libraries called Google API Client Libraries. These libraries:

  • Provide access to the API’s REST interface only, gRPC is not supported.
  • Have autogenerated interface code that may not be as idiomatic as our newer libraries.
  • Handle all the low-level details of communication with the server, including authenticating with Google.
  • Can be installed using familiar package management tools such as npm and pip.

You'll find links to these libraries on the relevant Cloud API's Client Libraries page, where necessary.

Using third party client libraries

Generally we recommend using our client libraries to access Cloud APIs. However, if you are an experienced developer and need to write your own custom code to directly access an API's REST interface using a third-party HTTP client library of your choice, you can find out more about how Cloud APIs work with different HTTP versions and implementations in our HTTP Guidelines.

Other ways to access Cloud APIs

If you don’t want to access an API programmatically, you can use the tools in our Google Cloud SDK to access the same services from the command line, or you can use them via the Google Cloud Developers Console web UI.