Translation API Reference

This reference documents REST query parameters and supported languages for the Translation API.

Query parameters

The query parameters you can use with the Translation API are summarized in the following table. All parameter values need to be URL encoded.

Parameter Meaning Notes
callback A JavaScript function to run when the response is received
  • (optional) Allows you to specify a JavaScript function to handle query results for pure client-side implementations.
  • Embed the API query in <script> tags.
  • Define the callback function in <script> tags.
format Format
  • (optional) Allows you to indicate that the text to be translated is either plain-text or HTML. A value of html indicates HTML and a value of text indicates plain-text.
  • Default: format=html.
key Your API key
  • (optional) A valid API key to handle requests for this API. If you are using OAuth service account credentials (recommended), this key is not necessary.
prettyprint (optional) Returns a response with indentations and line breaks
  • If prettyprint=true, the results returned by the server will be human readable (pretty printed).
  • Default: prettyprint=true.
q Source text
  • (required) The text for translation or language detection.
  • You can repeat this parameter more than once in a single request to translate multiple texts.
source Source language
  • (optional) The language of the source text. The value should be one of the language codes listed in Supported languages.
  • If a language is not specified, the system will attempt to identify the source language automatically.
target Target language
  • (required) The language to translate the source text into. The value should be one of the language codes listed in Supported languages.

Send feedback about...

Google Cloud Translation API Documentation