Translate Text

POST
https://libretranslate.com/translate

Body

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

Text(s) to translate

Show child attributes
Una de
string
Ejemplo
Hello world!
Array<any>
Ejemplo
[
  "Hello world!"
]
sourcestringrequired

Source language code or “auto” for auto detection

Ejemplo
en
targetstringrequired

Target language code

Ejemplo
es
formatstringtexthtmltext

Format of source text:

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

Preferred number of alternative translations

Ejemplo
3
api_keystring

API key

Ejemplo
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Response

Translation

Campos de la respuesta application/json
alternativesArray<string> | Array<Array<string>>

Alternative translations

Show child attributes
Una de
Array<string>
Array<Array<string>>
detectedLanguageobject | Array<object>
Show child attributes
Una de
confidencenumber<float>[0, 100]

Confidence value

Ejemplo
100
languagestring

Language code

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

Confidence value

Ejemplo
100
languagestring

Language code

translatedTextstring | Array<any>required

Translated text(s)

Show child attributes
Una de
string
Array<any>
400Bad Requesterror-response

Invalid request

Campos de la respuesta application/json
errorstring

Error message

403Forbiddenerror-response

Banned

Campos de la respuesta application/json
errorstring

Error message

429Too Many Requestserror-slow-down

Slow down

Campos de la respuesta application/json
errorstring

Reason for slow down

500Internal Server Errorerror-response

Translation error

Campos de la respuesta application/json
errorstring

Error message