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 stringstarget(required): target language code (example:nl)source(optional): source language code; if omitted, language detection is usedformat(optional):text(default) orhtmlformality(optional):auto,formal,informal,neutral
Limits (defaults)
- Max
qitems: 50 - Max total input characters (sum of all
qitems): 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 omitsdetectedSourceLanguage. - If you pass multiple
qitems, you get the same number of translations in the same order.