Determining language

Determines the language the given text is written in.

Overview

The response is returned as a language code. You can determine the language name by its code using the Getting the list of supported languages operation with the ui parameter.

JSON and JSONP interfaces

The response is returned in JSON format. If the callback parameter is set, the JSON object is wrapped in a function. The function name is specified in this parameter (JSONP).

Request syntax

https://translate.yandex.net/api/v1.5/tr.json/detect
 ? [key=<API key>]
 & text=<text>
 & [hint=<list of likely text languages>]
 & [callback=<callback function name>]
Query parameters
key

API key.

text *

The text whose language you want to define.

Attention. For the source text, use the URL encoding.
hint

List of the most likely languages (they will be given preference when determining the text language). The list is separated with commas.

callbackName of the callback function. Used to get a JSONP response.

*  Required

Note. All special characters must be escaped.

XML interface

The response is returned in XML format.

Request syntax

https://translate.yandex.net/api/v1.5/tr/detect
 ? [key=<API key>]
 & text=<text>
 & [hint=<list of likely text languages>]
Query parameters
key

API key.

text *

The text whose language you want to define.

Attention. For the source text, use the URL encoding.
hint

List of the most likely languages (they will be given preference when determining the text language). The list is separated with commas.

*  Required

Note. All special characters must be escaped.

Response codes

Description of response codes.

Value Description
200

The operation was completed successfully

401

Invalid API key

402

The API key is blocked

404

The daily limit on the amount of translated text is exceeded