---
keywords:
  - getLangs
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/tech-only/doc/dg/en/llms.txt


# getLangs method

Returns a list of translation directions supported by the service.

## Description

```javascript
string[] getLangs(string key);
```

## Input parameters

List of input parameters:

#|
||
**Parameter**
|
**Type**
|
**Description**
||
||
**Mandatory**
| >
| >
||
||
`key`
|
`string`
|
API key. Get a free API key on this [page](https://yandex.com/dev/dictionary/keys/get/?service=dict).
||

|#

**Sample request**:

XML interface:

```
https://dictionary.yandex.net/api/v1/dicservice/getLangs?key=APIkey
```

JSON interface:

```
https://dictionary.yandex.net/api/v1/dicservice.json/getLangs?key=APIkey
```

JSONP interface (for the "myCallback" function):

```
https://dictionary.yandex.net/api/v1/dicservice.json/getLangs?key=APIkey&callback=myCallback
```

## Returns {#translate-returns}

In the XML interface it returns an XML document with the root element `ArrayOfString`. For example:

```xml
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfString>
  <string>ru-ru</string>
  <string>ru-en</string>
  <string>ru-pl</string>
  <string>ru-uk</string>
  <string>ru-de</string>
  <string>ru-fr</string>
         ...
  <string>it-ru</string>
  <string>it-en</string>
  <string>tr-ru</string>
  <string>tr-en</string>
</ArrayOfString>
```

#### Error codes {#translate-returns}

#|

||
**Code**
|
**Value**
|
**Description**
||
||
`ERR_KEY_INVALID`
|
`401`
|
Invalid API key.
||
||
`ERR_KEY_BLOCKED`
|
`402`
|
This API key has been blocked.
||

|#

In the JSON interface, instead of XML elements, JavaScript objects are returned with the same names and semantics:

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

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

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

