v3

latestOpenAPI 3.0.0raw.githubusercontent.com2026-03-0936575.8 KB
Predict

Predict the language of a text

Predict the language of a text using a neural model. Use this POST version for long texts, as the GET version has a limit on the length of the text that can be provided in the query string.

post/predict/lang

Request body

textstring required

The text to predict language of

kinteger

The number of predictions to return

thresholdnumber

The minimum probability for a language to be returned

Example request

{
  "text": "hello world"
}

Response

the predicted languages

Example response

{
  "predictions": [
    {
      "lang": "en",
      "confidence": 0.9
    }
  ]
}