Documentation

Get the list of supported languages

Gets a list of translation directions supported by the service.
In this section:

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 with the name specified in this parameter (JSONP).

Request syntax

https://translate.yandex.net/api/v1.5/tr.json/getLangs ? 
key
[no-highlight[

API key. It is issued free of charge.

]no-highlight]
=<API key> & [ui
[no-highlight[

Required parameter.

In the response, supported languages are listed in the langs field with the definitions of the language codes. Language names are output in the language corresponding to the code in this parameter.

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

]no-highlight]
=<language code>] & [callback
[no-highlight[The name of the callback function. Use for getting a JSONP response.]no-highlight]
=<name of the callback function>]
key

API key. It is issued free of charge.

ui

Required parameter.

In the response, supported languages are listed in the langs field with the definitions of the language codes. Language names are output in the language corresponding to the code in this parameter.

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

callbackThe name of the callback function. Use for getting a JSONP response.
Note. All special characters must be escaped.
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

The response is returned in JSON format.

Note. Due to changes in the service, the dirs field has been deprecated. Supported languages are listed in the langs field.
With the "ui=en" parameter
{
    "dirs": [
        "ru-en",
        "ru-pl",
        "ru-hu",
        ...
    ],
   "langs": {
        "ru": "Russian",
        "en": "English",
        "pl": "Polish",
        ...
    }
} 

If the request can't be processed, an error message is returned.

{"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
[no-highlight[

API key. It is issued free of charge.

]no-highlight]
=<API key> & ui
[no-highlight[

Required parameter.

In the response, supported languages are listed in the langs field with the definitions of the language codes. Language names are output in the language corresponding to the code in this parameter.

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

]no-highlight]
=<language code>
key

API key. It is issued free of charge.

ui

Required parameter.

In the response, supported languages are listed in the langs field with the definitions of the language codes. Language names are output in the language corresponding to the code in this parameter.

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

Note. All special characters must be escaped.
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

The response is returned in XML format.

Note. Due to changes in the service, the dirs field has been deprecated. Supported languages are listed in the langs field.
With the "ui=en" parameter
<Langs>
    <dirs>
        <string>ru-en</string>
        <string>ru-pl</string>
        <string>ru-hu</string>
        ...
    </dirs>
    <langs>
        <Item key="ru" value="Russian"/>
        <Item key="en" value="English"/>
        <Item key="pl" value="Polish"/>
    </langs>
</Langs>

If the request can't be processed, an error message is returned.

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

Response codes

Explanations of possible response codes.

A response code is returned only if the request fails.

ValueDescription
401

Invalid API key

402

Blocked API key