---
type: api
title: Get script languages
description: Get a list of available script types, languages, and contexts.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-get-script-languages
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-get-script-languages
products:
  - Elasticsearch
---

# Get script languages

## Paths

- `GET` `/_script_language`

## Description

Get a list of available script types, languages, and contexts.

## Required authorization

- Cluster privileges: `manage`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/token-based-authentication-services)

## Response

`application/json`

- `language_contexts` (object[])
  - `contexts` (string[])
  - `language` (union)
    

Supported values include:
  - `painless`: Painless scripting language, purpose-built for Elasticsearch.
  - `expression`: Lucene’s expressions language, compiles a JavaScript expression to bytecode.
  - `mustache`: Mustache templated, used for templates.
  - `java`: Expert Java API
    Values: `painless`, `expression`, `mustache`, `java`
- `types_allowed` (string[])
## Code examples

#### Console

```console
GET _script_language
```

#### JavaScript

```javascript
const response = await client.getScriptLanguages();
```

#### Python

```python
resp = client.get_script_languages()
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_script_language" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.getScriptLanguages();
```

#### C#

```c#
var response = await client.GetScriptLanguagesAsync();
```

#### PHP

```php
$resp = $client->getScriptLanguages();
```

#### Ruby

```ruby
response = client.get_script_languages
```

