Language detection


Support for v1 is discontinued as of February 2019. The methods listed below will be deprecated. Please use v2.

Detects the language of the source text. The response is returned as the language code.



Parameters in the request body

All parameters must be URL-encoded. The maximum size of the POST request body is 30 KB.

Parameter Description
text Required parameter.
UTF-8 encoded text to detect the language of.
hint List of most probable languages (they will be given priority when detecting the language). The list items are comma-separated.
folderId Required parameter.
ID of your folder.
Learn more about how to find out the folder ID.


The response is returned in JSON format.

    "language": <code of the language the text is in>


Sample request

export FOLDER_ID=<folder id>
export TOKEN=<IAM-token>
curl -X POST \
     -H "Authorization: Bearer ${TOKEN}" \
     -d "folderId=${FOLDER_ID}" \
     --data-urlencode "text=Hello world" \

Response example

The response is returned in JSON format.

    "language": "en"