# Text language recognition

Machine translation (MT), supporting recognition of over 100 languages. The return value is ISO 639-1 compliant.

**Notice**：Single-tenant traffic limit: 20 QPS. Apps under the same tenant share the 20 QPS. The free version does not support calling this interface.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/translation/v1/text/detect
HTTP Method | POST
Rate Limit | [Special Rate Limit](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App、Store App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.** | Translate with machine translation(translation:text)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

### Request body

Parameter | Type | Required | Description
---|---|---|---
text | string | Yes | Text whose language is to be recognized<br>**Example value**: "Hello"

### Request body example
```json
{
    "text": "Hello"
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
language | string | Recognized text language. The return value is ISO 639-1 compliant.

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "language": "en"
    }
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 1140101 | invalid param | Parameter error. Check the input parameters according to the appropriate document.
500 | 1140102 | network anomaly | Service or network error. Request again.

