Get a list of supported languages

Get a list of translation directions supported by the service.

Summary:

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/getLangs
 ? [key=<API key>]
 & [ui=<language code>]
 & [callback=<callback function name>]
key

API key.

ui

Required parameter.

In the response, the list of supported languages can be found in the langs field together with an explanation of language codes. Language names are output in the language whose code corresponds to this parameter.

All language codes are listed in the list of supported languages.

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

API key.

ui

Required parameter.

In the response, the list of supported languages can be found in the langs field together with an explanation of language codes. Language names are output in the language whose code corresponds to this parameter.

All language codes are listed in the list of supported languages.

callbackName of the callback function. Used to get a JSONP response.
Note. All special characters must be escaped.
Example request
POST /api/v1.5/tr.json/getLangs?ui=en&key=API-KEY HTTP/1.1
Host: translate.yandex.net
Accept: */*
Content-Type: application/x-www-form-urlencoded
Example response

The response is returned in JSON format.

Note. Due to changes in service, the dirs field is no longer used. The list of supported languages is given in the langs field.
With the ui=ru parameter set
{
    "dirs": [
        "en-ru",
        "en-pl",
        "en-hu",
        ...
    ],
   "langs": {
        "en": "English",
        "ru": "Russian",
        "pl": "Polish",
        ...
    }} 
With the ui=ru parameter set
{
    "dirs": [
        "en-ru",
        "en-pl",
        "en-hu",
        ...
    ],
   "langs": {
        "en": "English",
        "ru": "Russian",
        "pl": "Polish",
        ...
    }} 
Example error

If the request cannot be executed, an error message is returned.

{"code":401,"message":"API key is invalid"}
{"code":401,"message":"API key is invalid"}

XML interface

The response is returned in XML format.

Request syntax

https://translate.yandex.net/api/v1.5/tr/getLangs
 ? [key=<API key>]
 & [ui=<language code>]
key

API key.

ui

Required parameter.

In the response, the list of supported languages can be found in the langs field together with an explanation of language codes. Language names are output in the language whose code corresponds to this parameter.

All language codes are listed in the list of supported languages.

key

API key.

ui

Required parameter.

In the response, the list of supported languages can be found in the langs field together with an explanation of language codes. Language names are output in the language whose code corresponds to this parameter.

All language codes are listed in the list of supported languages.

Note. All special characters must be escaped.
Example request
POST /api/v1.5/tr/getLangs?ui=en&key=API-KEY HTTP/1.1
Host: translate.yandex.net
Accept: */*
Content-Type: application/x-www-form-urlencoded
Example response

The response is returned in XML format.

Note. Due to changes in service, the dirs field is no longer used. The list of supported languages is given in the langs field.
With the ui=ru parameter set
<Langs>
    <dirs>
        <string>en-ru</string>
        <string>en-pl</string>
        <string>en-hu</string>
        ...
    </dirs>
    <langs>
        <Item key="en" value="English"/>
        <Item key="ru" value="Russian"/>
        <Item key="pl" value="Polish"/>
    </langs>
</Langs>
With the ui=ru parameter set
<Langs>
    <dirs>
        <string>en-ru</string>
        <string>en-pl</string>
        <string>en-hu</string>
        ...
    </dirs>
    <langs>
        <Item key="en" value="English"/>
        <Item key="ru" value="Russian"/>
        <Item key="pl" value="Polish"/>
    </langs>
</Langs>
Example error

If the request cannot be executed, an error message is returned.

<Error code="401" message="API key is invalid"/>
<Error code="401" message="API key is invalid"/>

Response codes

Description of response codes. The response code is returned only if the request fails.

Value Description
401

Invalid API key

402

The API key is blocked

Value Description
401

Invalid API key

402

The API key is blocked