Client libraries and Cloud APIs explained

While you can use Google Cloud APIs directly by making raw requests to theserver, client libraries provide simplifications that significantly reducethe amount of code you need to write.

This document explains methods for interacting with Google Cloud APIs:

  • Cloud Client Libraries (recommended)
  • Google API Client Libraries
  • Firebase mobile
  • Your own client code

To find client library information for a specific Google Cloud product,see the client libraries section within that product's documentation. To viewall Cloud Client Libraries, often organized by supported language, seeCloud Client Libraries.

Cloud Client Libraries

Cloud Client Libraries are the recommendedoption for accessing Cloud APIs programmatically, where available.Cloud Client Libraries use the latest client library model and:

  • Provide idiomatic code in each language to make Google Cloud APIsintuitive to use.
  • Provide a consistent style across client libraries to simplify working withmultiple Google Cloud services.
  • Handle all the low-level details of communication with the server, includingauthenticating with Google.
  • Can be installed using familiar package management tools such asnpm andpip.
  • In some cases, give you performance benefits by using gRPC. For moreinformation, seegRPC APIs.

The installation instructions and reference materials for Cloud Client Librariesdepend on the specific Google Cloud API and the programming languageyou are using. To find this information, see the documentation for thespecific Google Cloud product. Most products include a"Client Libraries" section in their documentation, which provideslanguage-specific guidance, installation steps, and links to the detailed APIreference.

You can find the documentation for a specific product by browsing theGoogle Cloud API library.

Try it for yourself

If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.

Get started for free

Google API Client Libraries

If Cloud Client Libraries aren't available for your preferred language for aspecific API, you can use theGoogle API Client Libraries.These are an earlier type of client library provided by Google.

You might also use these libraries if you're upgrading a project that alreadyuses them. These libraries:

  • Provide access to the API's REST interface only; gRPC is not supported.
  • Have auto-generated interface code that might not be as idiomatic as theCloud Client Libraries.
  • Handle all the low-level details of communication with the server, includingauthenticating with Google.
  • Can be installed using familiar package management tools such asnpm andpip.

Use the Firebase mobile platform

Firebase is the Google-wide solution for building applications onmobile devices. It offers an SDK with client code that lets you accessmobile-relevant Google Cloud APIs from iOS, Android, and Web apps.For information on the supported Google Cloud APIs and how to getstarted with Firebase, see theFirebase documentation.

Use your own client code

If you're an experienced developer and Cloud Client Libraries don't meet yourspecific needs, you can write your own custom code to access the service'slower-level service APIs directly.

REST/HTTP APIs

All Google Cloud APIs expose a JSON/REST interface. If you need to writeyour own custom code to directly access the REST API using a third-partyHTTP client library, you can find out more about how Google Cloud APIswork with different HTTP versions and implementations in theHTTP Guidelines.

gRPC APIs

gRPC is a language-neutral, platform-neutral, open source, remote procedure call(RPC) system initially developed at Google. You can find out more atgrpc.io.gRPC-enabled Google Cloud APIs generally have both REST and RPCinterfaces, so rather than just using JSON over HTTP to talk to the RESTinterface, gRPC-enabled API clients can also useprotocol buffers and gRPC over HTTP2 to talk to the RPC interface. You can find out if an API isgRPC-enabled by checking its APIs and Reference section.

If a Google Cloud API is gRPC-enabled, you can generate your own gRPCclient libraries for it in any gRPC-supported language. To do this, you'llneed the API'sprotocol buffers servicedefinition (typically available fromthe repository on GitHub).

You can then follow the instructions for your preferred language ongrpc.io to generate and use your client.

If you don't want to generate your own gRPC code, you can still benefit fromgRPC: a growing number of Cloud Client Libraries for gRPC-enabled APIs use gRPC"under the hood" to communicate with Google's servers. This is significantlymore efficient in terms of throughput and CPU usage—accessing an APIusing gRPC can increase throughput per CPU by as much as a factor of 10 comparedto the JSON REST API. Google plans to upgrade as many Cloud Client Libraries aspossible to gRPC; in the meantime, you'll still get all the other advantages ofGoogle's client library code.

Other ways to access Cloud APIs

If you don't want to access an API programmatically, you can access someof the same functionality using the tools inGoogle Cloud CLI or usingtheGoogle Cloud console.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.