Translate Text

POST
https://libretranslate.com/translate

Body

application/x-www-form-urlencoded
qstring | Array<any>required

Text(s) to translate

Show child attributes
Une option parmi
string
Exemple
Hello world!
Array<any>
Exemple
[
  "Hello world!"
]
sourcestringrequired

Source language code or “auto” for auto detection

Exemple
en
targetstringrequired

Target language code

Exemple
es
formatstringtexthtmltext

Format of source text:

  • text - Plain text
  • html - HTML markup
Exemple
text
alternativesinteger0

Preferred number of alternative translations

Exemple
3
api_keystring

API key

Exemple
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Response

Translation

Champs de la réponse application/json
alternativesArray<string> | Array<Array<string>>

Alternative translations

Show child attributes
Une option parmi
Array<string>
Array<Array<string>>
detectedLanguageobject | Array<object>
Show child attributes
Une option parmi
confidencenumber<float>[0, 100]

Confidence value

Exemple
100
languagestring

Language code

Array<object>
Show child attributes
confidencenumber<float>[0, 100]

Confidence value

Exemple
100
languagestring

Language code

translatedTextstring | Array<any>required

Translated text(s)

Show child attributes
Une option parmi
string
Array<any>
400Bad Requesterror-response

Invalid request

Champs de la réponse application/json
errorstring

Error message

403Forbiddenerror-response

Banned

Champs de la réponse application/json
errorstring

Error message

429Too Many Requestserror-slow-down

Slow down

Champs de la réponse application/json
errorstring

Reason for slow down

500Internal Server Errorerror-response

Translation error

Champs de la réponse application/json
errorstring

Error message