About this endpoint
What it does
Detects the language of the text you send in the request body. It returns a JSON object containing the detected language details inside a data object.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| text | String | Yes | Text sample for language detection (minimum 50 characters). |
Response
Returns a JSON object with a data object field. The data object contains the detected language details: language (String), code (String), iso_code (String), script (String), and confidence (Number). This endpoint returns the detection result in the data object on success.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object | Yes | Detected language details. |
| data.language | String | Yes | Detected language name. |
| data.code | String | Yes | ISO 639-3 code. |
| data.iso_code | String | Yes | ISO 639-1 code. |
| data.script | String | Yes | Writing script used by the detected language. |
| data.confidence | Number | Yes | Confidence score as a float. |