API usage overview

This guide provides an overview of using the Cloud Translation API and its reference documentation.

Client libraries, REST, and gRPC

You can access the API through client libraries, REST, or gRPC (Cloud Translation - Advanced only).

Client libraries

Google provides client libraries for many popular languages to access the APIs. If your desired programming language is supported by the client libraries, we recommend that you use this option.

Pros Cons
Maintained by Google.
Built-in authentication.
Built-in retries.
Idiomatic for each language.
Efficient protocol buffer HTTP request body.
Not available for all programming languages.

REST

The Cloud Translation API supports REST.

Pros Cons
Simple JSON interface.
Well supported by many Google and third-party tools and libraries.
You must build your own client.
You must implement authentication.
You must implement retries.
Less efficient JSON HTTP request body.

gRPC

Cloud Translation - Advanced supports gRPC. For more information, see the RPC reference, which provides a generic description of the types, methods, and fields generated for a gRPC library.

Pros Cons
Supports many programming languages.
Efficient protocol buffer HTTP request body.
You must generate your own client from Google-supplied protocol buffers.
You must implement authentication.
You must implement retries.

Type, method, and field names

Depending on whether you are using client libraries, REST, or gRPC, the type, method, and field names for the API vary:

  • REST is arranged by resource hierarchies and their methods.
  • Client libraries and gRPC are arranged by services and their methods.
  • REST field names use camel case, though the API service will accept either camel case or snake case.
  • gRPC field names use snake case.
  • Client library field names use either title case, camel case or snake case, depending on which name is idiomatic for the language.

API editions

Cloud Translation offers two editions: Basic (v2) and Advanced (v3). Each edition has its own set of APIs and capabilities. For more information, see the Editions page.

What's next

  • For more information about using client libraries or REST, see get started translating text with v3 or v2.