Detects the language of text within a request.

HTTP request

POST https://api-gl.lingvanex.com/language/translate/v2/detect

Detect languages

Query parameters

Parameters
qstring
Required The input text upon which to perform language detection. Repeat this parameter to perform language detection on multiple text inputs.
keystring
A valid API key to handle requests for this API.

Response body

If successful, the response body contains data with the following structure:

{
  "data": {
    object(DetectLanguageResponseList)
  },
}
Fields
dataobject (ListValue)
The list of language detection responses. This list will contain a language detection response for each query (q) sent in the language detection request.

DetectLanguageResponseList

A response list contains a list of separate language detection responses.

{
  "detections": [
    array
  ],
}
Fields
detections[]array (ListValue format)

Language detection results for each input text piece.

The detections ListValue includes the following values:

language (string) - The detected language
isReliable (boolean) - Deprecated Indicates whether the language detection result is reliable
confidence (float) - Deprecated The confidence of the detection result for this language

★ We recommend not basing any decisions or thresholds on the isReliable or confidence values.

For example:

"detections": [
            [
                {
                    "confidence": 1,
                    "language": "zh-Hant",
                    "isReliable": false
                }
            ],
            [
                {
                    "confidence": 1,
                    "language": "es",
                    "isReliable": false
                }
            ]
        ]