getLangs method

Returns a list of languages supported by the service.

Description

string[] getLangs(string key);

Input parameters

Example of input parameters:

Parameter Type Description
Required
key string API key. Get a free API key on this page.

Request example:

XML interface:

https://predictor.yandex.net/api/v1/predict/getLangs?key=APIkey

JSON interface:

https://predictor.yandex.net/api/v1/predict.json/getLangs?key=APIkey

JSONP interface (for the myCallback function):

https://predictor.yandex.net/api/v1/predict.json/getLangs?key=APIkey&callback=myCallback

Returns

In the XML interface, the request returns an XML document with the ArrayOfString root element. For example:

<ArrayOfString>
  <string>ru</string>
  <string>en</string>
  <string>pl</string>
  <string>uk</string>
  <string>de</string>
  <string>fr</string>
  <string>es</string>
  <string>it</string>
  <string>tr</string>
</ArrayOfString>
Error codes
Code Value Description
ERR_KEY_INVALID 401

API key is invalid.

ERR_KEY_BLOCKED 402

API key is blocked.

In the JSON interface, JavaScript objects are returned instead of XML elements. The objects have the same names and semantics as the XML elements:

["ru","en","pl","uk","de","fr","es","it","tr"]

In the JSONP interface, the same JavaScript objects are returned in a callback function (for example, myCallback):

myCallback(["ru","en","pl","uk","de","fr","es","it","tr"])