Method: languages

Returns a list of supported languages for translation.

HTTP request

GET https://translation.googleapis.com/language/translate/v2/languages

The URL uses Google API HTTP annotation syntax.

Query parameters

Parameters
target

string

The target language code for the results. If specified, then the language names are returned in the name field of the response, localized in the target language. If you do not supply a target language, then the name field is omitted from the response and only the language codes are returned.

model

string

The translation model of the supported languages. Can be either base to return languages supported by the Phrase-Based Machine Translation (PBMT) model, or nmt to return languages supported by the Neural Machine Translation (NMT) model. If omitted, then all supported languages are returned.

Languages supported by the NMT model can only be translated to or from English (en).

key

string

A valid API key to handle requests for this API. If you are using OAuth 2.0 service account credentials (recommended), do not supply this parameter.

Response body

If successful, the response body contains data with the following structure:

JSON representation
{
  "data": {
    object(GetSupportedLanguagesResponseList)
  },
}
Fields
data

object(GetSupportedLanguagesResponseList)

A list of supported language responses. This list will contain an entry for each language supported by the Translation API.

Authorization

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

GetSupportedLanguagesResponseList

A response list contains a list of separate supported language responses.

JSON representation
{
  "languages": [
    {
      object(GetSupportedLanguagesResponseLanguage)
    }
  ],
}
Fields
languages[]

array (GetSupportedLanguagesResponseLanguage)

The set of supported languages.

GetSupportedLanguagesResponseLanguage

A single supported language response corresponds to information related to one supported language.

JSON representation
{
  "language": string,
  "name": string,
}
Fields
language

string

Supported language code, generally consisting of its ISO 639-1 identifier. (E.g. 'en', 'ja'). In certain cases, BCP-47 codes including language + region identifiers are returned (e.g. 'zh-TW' and 'zh-CH')

name

string

Human readable name of the language localized to the target language.

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Translation API