Skip to main content

Translate v2

Endpoint

POST /language/translate/v2

This endpoint is compatible with the Google Translate v2 request/response shape for the fields below.

Request body

{
"q": "Hello world",
"target": "nl",
"source": "en",
"format": "text",
"formality": "auto"
}

Fields

  • q (required): string or array of strings
  • target (required): target language code (example: nl)
  • source (optional): source language code; if omitted, language detection is used
  • format (optional): text (default) or html
  • formality (optional): auto, formal, informal, neutral

Limits (defaults)

  • Max q items: 50
  • Max total input characters (sum of all q items): 10,000

If you exceed limits you’ll get 400 INVALID_ARGUMENT.

Response body

{
"data": {
"translations": [
{
"translatedText": "Hallo wereld",
"detectedSourceLanguage": "en"
}
]
}
}

Notes:

  • If you provide source, the response omits detectedSourceLanguage.
  • If you pass multiple q items, you get the same number of translations in the same order.