Countries Dataset
curl --request GET \
--url https://api.flystack.dev/v1/countries \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.flystack.dev/v1/countries"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.flystack.dev/v1/countries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flystack.dev/v1/countries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.flystack.dev/v1/countries"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.flystack.dev/v1/countries")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flystack.dev/v1/countries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body[
{
"code": "FR",
"code3": "FRA",
"name": "France",
"population": 66987244,
"continent": "EU",
"currency": "EUR",
"names": {
"de": "Frankreich",
"en": "France",
"es": "Francia",
"fr": "France",
"ja": "フランス"
}
}
]
Datasets
Countries Dataset
Look up countries and localization data like ISO codes, continent, population, and currency.
GET
/
v1
/
countries
Countries Dataset
curl --request GET \
--url https://api.flystack.dev/v1/countries \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.flystack.dev/v1/countries"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.flystack.dev/v1/countries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flystack.dev/v1/countries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.flystack.dev/v1/countries"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.flystack.dev/v1/countries")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flystack.dev/v1/countries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body[
{
"code": "FR",
"code3": "FRA",
"name": "France",
"population": 66987244,
"continent": "EU",
"currency": "EUR",
"names": {
"de": "Frankreich",
"en": "France",
"es": "Francia",
"fr": "France",
"ja": "フランス"
}
}
]
Use the Countries Dataset when you need localization in your product—country names, standard ISO codes, continent mapping, and currency codes. It’s especially helpful for travel apps that need to automatically display local currency or present country-aware UI.
Authentication
string
required
Your FlyStack API token. You can create one from the dashboard (see Authentication).
Query parameters
string
Filter by country ISO-2 code (e.g.,
US).string
Filter by country ISO-3 code (e.g.,
USA).string
Filter by continent code:
AF, AN, AS, EU, NA, OC, SA.string
Comma-separated list of fields to return (e.g.,
name,code,code3,currency).Pagination
number
Max number of rows per response: 1,000 by default, up to 10,000 (limits may depend on your plan).
number
Pagination offset (0+). When more rows match, the response has the headers
X-Has-More: true and X-Next-Offset: pass its value as offset to get the next page.Response
The endpoint returns a list of countries.Countries dataset response fields
[
{
"code": "FR",
"code3": "FRA",
"name": "France",
"population": 66987244,
"continent": "EU",
"currency": "EUR",
"names": {
"de": "Frankreich",
"en": "France",
"es": "Francia",
"fr": "France",
"ja": "フランス"
}
}
]
See also
- Airports Dataset API
- Real-Time Flights API
- Flight Schedules API (see Schedules)