For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.holidays.rest/holidays-rest-api/llms.txt. For full documentation content, see https://docs.holidays.rest/holidays-rest-api/llms-full.txt.

# languages

GET https://api.holidays.rest/v1/languages

This endpoint retrieves all languages that are supported by holidays.rest when retrieving public holidays. By default, the API returns holiday names in all languages that are listed by this endpoint. However, if you want to filter specific languages, you can use the `lang` query parameter and `alpha2` code of the language.

Reference: https://docs.holidays.rest/holidays-rest-api/languages

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /v1/languages:
    get:
      operationId: languages
      summary: languages
      description: >-
        This endpoint retrieves all languages that are supported by
        holidays.rest when retrieving public holidays. By default, the API
        returns holiday names in all languages that are listed by this endpoint.
        However, if you want to filter specific languages, you can use the
        `lang` query parameter and `alpha2` code of the language.
      tags:
        - ''
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/V1LanguagesGetResponsesContentApplicationJsonSchemaItems
servers:
  - url: https://api.holidays.rest
components:
  schemas:
    V1LanguagesGetResponsesContentApplicationJsonSchemaItems:
      type: object
      properties:
        alpha2:
          type: string
        name:
          type: string
        supported:
          type: boolean
      required:
        - alpha2
        - name
        - supported
      title: V1LanguagesGetResponsesContentApplicationJsonSchemaItems
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python languages_example
import requests

url = "https://api.holidays.rest/v1/languages"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript languages_example
const url = 'https://api.holidays.rest/v1/languages';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go languages_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.holidays.rest/v1/languages"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby languages_example
require 'uri'
require 'net/http'

url = URI("https://api.holidays.rest/v1/languages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java languages_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.holidays.rest/v1/languages")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php languages_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.holidays.rest/v1/languages', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp languages_example
using RestSharp;

var client = new RestClient("https://api.holidays.rest/v1/languages");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift languages_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.holidays.rest/v1/languages")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```