List available countries
Introduction
Retrieves a list of currently supported countries and states along with their ISO codes.
Use this list as a guide of ISO codes, countries and regions supported across Festivo products.
Rate limiting and throttling
We're here to support the speed of your business - there are no rate limits in place.
Usage
To list available countries, you'll need to make a request to GET /countries
endpoint.
You can alter received response by using filters
- JavaScript
- PHP
- Go
const axios = require('axios');
axios.get('https://api.getfestivo.com/v3/public-holidays/countries', {
params: {
api_key: "XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX"
}
})
.then(function (response) {
// handle success
console.log(response)
})
.catch(function (error) {
// handle error
console.log(error)
})
.then(function () {
// always executed
})
$ch = curl_init();
$data = http_build_query(array(
"api_key" => "XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX"
));
$getUrl = "https://api.getfestivo.com/v3/public-holidays/countries?" . $data;
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_URL, $getUrl);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$response = curl_exec($ch);
if(curl_error($ch)){
echo 'Request Error:' . curl_error($ch);
} else {
echo $response;
}
curl_close($ch);
import (
"net/http"
"os"
)
req, err := http.NewRequest("GET", "https://api.getfestivo.com/v3/public-holidays/countries", nil)
if err != nil {
// handle fatal error
os.Exit(1)
}
q := url.Values{}
q.Add("api_key", "XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX")
req.URL.RawQuery = q.Encode()
resp, err := client.Do(req)
if err != nil {
// handle error
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
Filters
In GET query you are able to append more parameters. Please make yourself comfortable with the list below before you start using our Public Holidays API.
Parameter | Required | Description | Type | Example |
---|---|---|---|---|
code | no | ISO 3166-1 alpha-2 country code | string | US |