About this endpoint
What it does
Detects the language of the input text and returns the most likely language code along with a per-language probability breakdown.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| text | String | Yes | Input text. Maximum length: 512 characters. |
Response
Returns a JSON object with a detected string field and a probabilities array field. detected is the ISO 639-1 language code for the most likely language, and probabilities contains per-language objects with lang and prob fields.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| detected | String | No | ISO 639-1 language code. |
| probabilities | Object Array | No | Array of per-language probability objects. |
| probabilities[].lang | String | No | Language code for the candidate language. |
| probabilities[].prob | Number | No | Probability associated with the candidate language. |