Predict the translation of a text

POST /translate/predict
application/json

Body Required

  • text string Required

    The text to predict

    Minimum length is 3, maximum length is 1500.

  • target_lang string Required

    The target language

  • The source language

    Default value is auto.

Responses

  • 200 application/json

    Default Response

    Hide response attributes Show response attributes object
    • status boolean

      Default value is true.

    • message string

      Default value is success.

    • result object

      Additional properties are allowed.

      Hide result attributes Show result attributes object
      • text string

        The translated text

      • lang string

        The detected language

  • 400 application/json

    Invalid request error

    Hide response attributes Show response attributes object
  • 401 application/json

    Authorization error

    Hide response attributes Show response attributes object
  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
POST /translate/predict
curl \
 -X POST https://api.itsrose.rest/translate/predict \
 -H "Content-Type: application/json" \
 -d '{"text":"Hello, world!","target_lang":"id","source_lang":"auto"}'
Request examples
{
  "text": "Hello, world!",
  "target_lang": "id",
  "source_lang": "auto"
}
Response examples (200)
{
  "status": true,
  "message": "success",
  "result": {
    "text": "string",
    "lang": "string"
  }
}
Response examples (400)
{
  "status": false,
  "message": "string",
  "result": {}
}
Response examples (401)
{
  "status": false,
  "message": "string",
  "result": {}
}
Response examples (500)
{
  "status": false,
  "message": "string",
  "result": {}
}