Translates input text, returning translated text.

HTTP request

POST https://api-gl.lingvanex.com/language/translate/v2

Translate HTML

Query parameters

Parameters
qstring

Required The input text to translate. Provide an array of strings to translate multiple phrases. The maximum number of strings is 128.
targetstring

Required The language to use for translation of the input text, set to one of the language codes listed in Language Support.
formatstring

The format of the source text, in either HTML (default) or plain-text. A value of html indicates HTML and a value of text indicates plain-text.
sourcestring

The language of the source text, set to one of the language codes listed in Language Support. If the source language is not specified, the API will attempt to detect the source language automatically and return it within the response.
modelstring

Not optional, does not affect anything.
keystring

A valid API key to handle requests for this API.

Response body

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

{
  "data": {
    object(TranslateTextResponseList)
  },
}
Fields
dataobject(TranslateTextResponseList)

The list of language translation responses. This list contains a language translation response for each query (q) sent in the language translation request.

TranslateTextResponseList

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

{
  "translations": [
    array
  ],
}
Fields
translations[]array (TranslateTextResponseTranslation)

Contains list of translation results of the supplied text.

TranslateTextResponseTranslation

Contains a list of translation results for the requested text.

{
  "detectedSourceLanguage": string,
  "model": string,
  "translatedText": string,
}
Fields
detectedSourceLanguagestring

The source language of the initial request, detected automatically, if no source language was passed within the initial request. If the source language was passed, auto-detection of the language will not occur and this field will be omitted.
modelstring

The translation model. Cloud Translation – Basic offers only the nmt Neural Machine Translation (NMT) model.
If you did not include a model parameter with your request, then this field is not included in the response.
translatedTextstring

Text translated into the target language.