> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.holidays.rest/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.holidays.rest/_mcp/server.

# country

GET https://api.holidays.rest/v1/country/{countryID}

This endpoint retrieves a specific country, including its subdivisions. You can use the `alpha2` code to retrieve public holidays of a region when calling the `holidays` endpoint.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /v1/country/{countryID}:
    get:
      operationId: country
      summary: country
      description: "This endpoint retrieves a specific country, including its subdivisions. You can use the\_`alpha2`\_code to retrieve public holidays of a region when calling the\_`holidays`\_endpoint."
      tags:
        - ''
      parameters:
        - name: countryID
          in: path
          description: (Required) Country code in ISO-3166 alpha-2 format
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/country_Response_200'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetV1CountryCountryidRequestUnauthorizedError
servers:
  - url: https://api.holidays.rest
    description: https://api.holidays.rest
components:
  schemas:
    V1CountryCountryIdGetResponsesContentApplicationJsonSchemaSubdivisionsItems:
      type: object
      properties:
        name:
          type: string
        alpha2:
          type: string
      required:
        - name
        - alpha2
      title: >-
        V1CountryCountryIdGetResponsesContentApplicationJsonSchemaSubdivisionsItems
    country_Response_200:
      type: object
      properties:
        name:
          type: string
        long_name:
          type: string
        region:
          type: string
        subregion:
          type: string
        world_region:
          type: string
        alpha2:
          type: string
        subdivisions:
          type: array
          items:
            $ref: >-
              #/components/schemas/V1CountryCountryIdGetResponsesContentApplicationJsonSchemaSubdivisionsItems
      required:
        - name
        - long_name
        - region
        - subregion
        - world_region
        - alpha2
        - subdivisions
      title: country_Response_200
    GetV1CountryCountryidRequestUnauthorizedError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
      title: GetV1CountryCountryidRequestUnauthorizedError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Response**

```json
{
  "name": "United States of America",
  "long_name": "The United States of America",
  "region": "Americas",
  "subregion": "Northern America",
  "world_region": "AMER",
  "alpha2": "US",
  "subdivisions": [
    {
      "name": "Alaska",
      "alpha2": "AK"
    },
    {
      "name": "Alabama",
      "alpha2": "AL"
    },
    {
      "name": "Arkansas",
      "alpha2": "AR"
    },
    {
      "name": "American Samoa",
      "alpha2": "AS"
    },
    {
      "name": "Arizona",
      "alpha2": "AZ"
    },
    {
      "name": "California",
      "alpha2": "CA"
    },
    {
      "name": "Colorado",
      "alpha2": "CO"
    },
    {
      "name": "Connecticut",
      "alpha2": "CT"
    },
    {
      "name": "District of Columbia",
      "alpha2": "DC"
    },
    {
      "name": "Delaware",
      "alpha2": "DE"
    },
    {
      "name": "Florida",
      "alpha2": "FL"
    },
    {
      "name": "Georgia",
      "alpha2": "GA"
    },
    {
      "name": "Guam",
      "alpha2": "GU"
    },
    {
      "name": "Hawaii",
      "alpha2": "HI"
    },
    {
      "name": "Iowa",
      "alpha2": "IA"
    },
    {
      "name": "Idaho",
      "alpha2": "ID"
    },
    {
      "name": "Illinois",
      "alpha2": "IL"
    },
    {
      "name": "Indiana",
      "alpha2": "IN"
    },
    {
      "name": "Kansas",
      "alpha2": "KS"
    },
    {
      "name": "Kentucky",
      "alpha2": "KY"
    },
    {
      "name": "Louisiana",
      "alpha2": "LA"
    },
    {
      "name": "Massachusetts",
      "alpha2": "MA"
    },
    {
      "name": "Maryland",
      "alpha2": "MD"
    },
    {
      "name": "Maine",
      "alpha2": "ME"
    },
    {
      "name": "Michigan",
      "alpha2": "MI"
    },
    {
      "name": "Minnesota",
      "alpha2": "MN"
    },
    {
      "name": "Missouri",
      "alpha2": "MO"
    },
    {
      "name": "Northern Mariana Islands",
      "alpha2": "MP"
    },
    {
      "name": "Mississippi",
      "alpha2": "MS"
    },
    {
      "name": "Montana",
      "alpha2": "MT"
    },
    {
      "name": "North Carolina",
      "alpha2": "NC"
    },
    {
      "name": "North Dakota",
      "alpha2": "ND"
    },
    {
      "name": "Nebraska",
      "alpha2": "NE"
    },
    {
      "name": "New Hampshire",
      "alpha2": "NH"
    },
    {
      "name": "New Jersey",
      "alpha2": "NJ"
    },
    {
      "name": "New Mexico",
      "alpha2": "NM"
    },
    {
      "name": "Nevada",
      "alpha2": "NV"
    },
    {
      "name": "New York",
      "alpha2": "NY"
    },
    {
      "name": "Ohio",
      "alpha2": "OH"
    },
    {
      "name": "Oklahoma",
      "alpha2": "OK"
    },
    {
      "name": "Oregon",
      "alpha2": "OR"
    },
    {
      "name": "Pennsylvania",
      "alpha2": "PA"
    },
    {
      "name": "Puerto Rico",
      "alpha2": "PR"
    },
    {
      "name": "Rhode Island",
      "alpha2": "RI"
    },
    {
      "name": "South Carolina",
      "alpha2": "SC"
    },
    {
      "name": "South Dakota",
      "alpha2": "SD"
    },
    {
      "name": "Tennessee",
      "alpha2": "TN"
    },
    {
      "name": "Texas",
      "alpha2": "TX"
    },
    {
      "name": "United States Minor Outlying Islands",
      "alpha2": "UM"
    },
    {
      "name": "Utah",
      "alpha2": "UT"
    },
    {
      "name": "Virginia",
      "alpha2": "VA"
    },
    {
      "name": "Virgin Islands, U.S.",
      "alpha2": "VI"
    },
    {
      "name": "Vermont",
      "alpha2": "VT"
    },
    {
      "name": "Washington",
      "alpha2": "WA"
    },
    {
      "name": "Wisconsin",
      "alpha2": "WI"
    },
    {
      "name": "West Virginia",
      "alpha2": "WV"
    },
    {
      "name": "Wyoming",
      "alpha2": "WY"
    }
  ]
}
```

**SDK Code**

```python country_example
import requests

url = "https://api.holidays.rest/v1/country/US"

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

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

print(response.json())
```

```javascript country_example
const url = 'https://api.holidays.rest/v1/country/US';
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 country_example
package main

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

func main() {

	url := "https://api.holidays.rest/v1/country/US"

	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 country_example
require 'uri'
require 'net/http'

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

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 country_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp country_example
using RestSharp;

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

```swift country_example
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.holidays.rest/v1/country/US")! 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()
```