Cities Dataset
curl --request GET \
--url https://api.flystack.dev/v1/cities \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.flystack.dev/v1/cities"
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/cities', 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/cities",
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/cities"
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/cities")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flystack.dev/v1/cities")
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[
{
"name": "Singapore",
"city_code": "SIN",
"un_locode": "SGSIN",
"lat": 1.28967,
"lng": 103.85007,
"alt": 22,
"timezone": "Asia/Singapore",
"country_code": "SG",
"population": 3547809,
"names": {
"en": "Singapore",
"fr": "Singapour",
"de": "Singapur",
"es": "Singapur"
},
"wikipedia": "https://en.wikipedia.org/wiki/Singapore",
"slug": "singapore-sin-sg"
}
]
Datasets
Cities Dataset
Retrieve cities worldwide using IATA city codes and location metadata.
GET
/
v1
/
cities
Cities Dataset
curl --request GET \
--url https://api.flystack.dev/v1/cities \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.flystack.dev/v1/cities"
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/cities', 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/cities",
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/cities"
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/cities")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flystack.dev/v1/cities")
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[
{
"name": "Singapore",
"city_code": "SIN",
"un_locode": "SGSIN",
"lat": 1.28967,
"lng": 103.85007,
"alt": 22,
"timezone": "Asia/Singapore",
"country_code": "SG",
"population": 3547809,
"names": {
"en": "Singapore",
"fr": "Singapour",
"de": "Singapur",
"es": "Singapur"
},
"wikipedia": "https://en.wikipedia.org/wiki/Singapore",
"slug": "singapore-sin-sg"
}
]
City data complements airport data. If you need destination functionality that does not depend on a specific airport, you can use cities—or combine both to build richer travel experiences.
Cities are especially useful for maps and clustering (grouping multiple airports under a metro area), and for search in booking, hotel, and GDS-like workflows where an IATA city code represents “all airports in a city”.
Authentication
string
required
Your FlyStack API token. You can create one from the dashboard (see Authentication).
Query parameters
string
Filter by IATA city code (e.g.,
SIN).string
Filter by country ISO-2 code (e.g.,
SG).string
Comma-separated list of fields to return (e.g.,
name,city_code,lat,lng,country_code).The response can be shortened for readability when using
_fields. Data coverage may vary by city.Response
The endpoint returns a list of cities.Cities dataset response fields
string
City name.
string
Metropolitan area IATA code.
string
United Nations location code (when available).
number
Latitude.
number
Longitude.
number
City elevation (meters, when available).
string
IANA timezone (when available).
string
ISO-2 country code.
Show Enrichment
Show Enrichment
string
Unique city identifier.
[
{
"name": "Singapore",
"city_code": "SIN",
"un_locode": "SGSIN",
"lat": 1.28967,
"lng": 103.85007,
"alt": 22,
"timezone": "Asia/Singapore",
"country_code": "SG",
"population": 3547809,
"names": {
"en": "Singapore",
"fr": "Singapour",
"de": "Singapur",
"es": "Singapur"
},
"wikipedia": "https://en.wikipedia.org/wiki/Singapore",
"slug": "singapore-sin-sg"
}
]