City data complements and extends airport data, if you need to create functionality that does not depend on airports, you can use cities instead, as well as combine them.
The cities API allows you to display destinations on a map, grouping airports into clusters of cities.
It is also important to know that when integrated with various ticket booking systems, hotel search and GDS-services, IATA city codes can act as a metropolitan area search, showing results at all airports in the city.
https://airlabs.co/api/v9/cities?city_code=SIN&api_key={{params.api_key}}
Parameter | Description | |
---|---|---|
api_key |
required | Your API Key from acccount dashboard. |
city_code |
optional | Filtering by IATA City code. |
country_code |
optional | Filtering by Country ISO 2 code from Countries DB. |
_fields |
optional | Fields to return (comma separated, e.g.: name,city_code,lat,lng,country_code) |
[{
"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": {
"de": "Singapur",
"hi": "सिंगापुर",
"fi": "Singapore",
"ru": "Сингапур",
"lo": "ປະເທດສິງກະໂປ",
"pt": "Singapura",
"yue": "星架坡",
"fr": "Singapour",
"hak": "Sîn-kâ-po",
"gan": "新加坡",
"wuu": "新加坡",
"uk": "Сінгапур",
"km": "សិង្ហបុរី",
"sv": "Singapore",
"ko": "싱가포르",
"mr": "सिंगापूर",
"el": "Σιγκαπούρη",
"en": "Singapore",
"it": "Singapore",
"my": "စင်ကာပူနိုင်ငံ",
"ta": "சிங்கப்பூர்",
"es": "Singapur",
"zh": "新加坡",
"pa": "ਸਿੰਗਾਪੁਰ",
"ar": "سنغافورة",
"th": "สิงค์โปร",
"ja": "シンガポール",
"fa": "سنگاپور",
"da": "Singapore",
"he": "סינגפור"
},
"wikipedia": "https://en.wikipedia.org/wiki/Singapore",
"slug": "singapore-sin-sg"
}]
Parameter | Description |
---|---|
name |
City name. Available in the Free plan. |
city_code |
Metropolitan area IATA code. Available in the Free plan. |
un_locode |
United Nations location code. |
lat |
Geo Latitude. Available in the Free plan. |
lng |
Geo Longitude. Available in the Free plan. |
alt |
City elevation (in meters). |
timezone |
Airport location timezone. |
country_code |
ISO 2 country code from Countries DB. Available in the Free plan. |
population |
Total city population. |
names |
Alternative names in different languages. |
wikipedia |
Link to city information in Wikipedia. |
slug |
AirLabs generated uniq Airport ID, which you can use for SEO, etc. |
By the way, you may also be interested in the leaflet.js library.