Skip to main content

Translate text

Use this call to translate a list of segments with text from a given source language to the defined target language. You should add your text directly to the POST /v2/translate call to get it translated back.

Tip: Before sending the text


Example of a translate text request:
For a call requesting a translation of the text "Hello from LanguageWire!" using the model English-United Kingdom (en-GB) to German-Germany (de-DE):

{ "source": "en-GB", "target": "de-DE", "segments": [{ "text": "Hello from LanguageWire!" }] }

This request would return a response similar to:

{ "translations": [{ "translation": "Hallo von LanguageWire!" }] }

The response is returned in a synchronous manner. This means that if the source text is longer or more segments are submitted, it will take longer to receive a response.


Request Body REQUIRED
source BCP-47 REQUIRED

Possible values: 2 ≤ length ≤ 25

Source language code

target BCP-47 REQUIRED

Possible values: 2 ≤ length ≤ 25

Target language code

segments object[] REQUIRED

A list of segments containing text in the source language to translate into the target language.
A maximum of 100 segments is allowed to be translated at once.

Note

The cumulative length of the text in all segments must not exceed 10,000 characters. See more details about allowed size and text recommendations in the text management guide.

text Text REQUIRED

Possible values: length ≤ 10000

Text in the source language to translate. A segment ideally contains a single sentence, but you can send multiple sentences as a single segment too.
A segment can contain at most 10,000 characters.

Responses
200

Successful response

Schema OPTIONAL
translations object[]
translation Translation

The translation of the source text to the target language.

401

The access token provided is missing, expired, revoked, malformed, or invalid for other reasons. The client MAY request a new access token and retry the protected resource request.

Schema OPTIONAL
detail Detail

A generic JSON value, typically a string describing the error.

403

The request requires higher privileges than provided by the access token. The request should not be retried.

Schema OPTIONAL
detail Detail

A generic JSON value, typically a string describing the error.

422

Unsupported language pair

Schema OPTIONAL
detail Detail

Unsupported language pair

429

Too many requests in the time interval

Schema OPTIONAL
detail Detail

A generic JSON value, typically a string describing the error.

500

Internal server error

Schema OPTIONAL
detail Detail

A generic JSON value, typically a string describing the error.