Translate text
This endpoint has been deprecated and may be removed in future versions of the API.
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 /v1/translate call to get it translated back.
- Run the
GET /v1/languagesendpoint to check the selected source/target language is supported by MT API. - Pay special attention to the direction (source-target) of the language pair codes.
- Check the Text management guide for restrictions and recommendations.
Example of a translate text request:
For a call requesting a translation of the text "Hello from LanguageWire!" using the model English (en) to German (de):
{ "source": "en", "target": "de", "segments": ["Hello from LanguageWire!"] }
This request would return a response similar to:
[{ "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 — REQUIREDSource language code. If the field is not provided or is set to |
target BCP-47 — REQUIREDPossible values: 2 ≤ length ≤ 25 Target language code |
segments string[] — REQUIREDPossible values: length ≤ 10000 A list of segments containing text in the source language to translate into the target language. 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. |
| Responses | |||||
|---|---|---|---|---|---|
200Successful response
| |||||
400Unsupported language pair
| |||||
401The 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.
| |||||
403The request requires higher privileges than provided by the access token. The request should not be retried.
| |||||
422Validation error
| |||||
429Too many requests in the time interval
|