Regions
ISO 3166-2 regional subdivisions (states, provinces, territories). The primary integration path is resolving iso_region from Airports into a human-readable label — for example US-NY → New York. Two operations: list regions (filter by country or continent) and fetch one region by code.
Filter when you can. An unfiltered list returns ~3,900 rows worldwide. Pass country or continent in production UIs.
| Endpoint | When to use |
|---|---|
GET /regions | Region selectors filtered by country or continent |
GET /regions/{code} | Resolve iso_region from an airport record |
List regions
Returns regions optionally filtered by country and/or continent.
Request
Requirements
x-api-key on every request (direct subscription). Learn more →https://data.skylinkapi.com/v3/regions| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
country | string | No | all countries | ISO 3166-1 alpha-2 country code, e.g. US |
continent | string | No | all continents | Continent code (AF, AN, AS, EU, NA, OC, SA) |
Response
{
"regions": [
{
"id": 306110,
"code": "US-NY",
"local_code": "NY",
"name": "New York",
"continent": null,
"iso_country": "US",
"wikipedia_link": "https://en.wikipedia.org/wiki/New_York",
"keywords": "Airports in New York"
}
],
"total": 1
}| Field | Type | Required | Null? | Description |
|---|---|---|---|---|
regions | array | Yes | Never | Matching region records |
total | integer | Yes | Never | Number of returned regions |
Region item (regions[])
| Field | Type | Required | Null? | Description |
|---|---|---|---|---|
id | integer | Yes | Never | Numeric record identifier |
code | string | Yes | Never | ISO 3166-2 region code, e.g. US-NY |
local_code | string | null | No | Yes | Country-local short code (e.g. NY) |
name | string | Yes | Never | Region name |
continent | string | null | No | Yes | Continent code when assigned |
iso_country | string | Yes | Never | Parent country alpha-2 code |
wikipedia_link | string | null | No | Yes | Reference URL |
keywords | string | null | No | Yes | Free-text tags |
Get region by code
Retrieve a single region by ISO 3166-2 code (e.g. US-CA, GB-ENG). Returns 404 if the code is not found.
Request
https://data.skylinkapi.com/v3/regions/{code}| Parameter | Type | Required | Description |
|---|---|---|---|
code | string | Yes | ISO 3166-2 region code path parameter |
Response
{
"id": 306110,
"code": "US-NY",
"local_code": "NY",
"name": "New York",
"continent": null,
"iso_country": "US",
"wikipedia_link": "https://en.wikipedia.org/wiki/New_York",
"keywords": "Airports in New York"
}Same object shape as list items. Unmatched list filters return regions: [] and total: 0 — not an error.
Client types
"""Region reference models for /regions endpoints."""from __future__ import annotationsfrom dataclasses import dataclass@dataclassclass RegionsListRequest: country: str | None = None continent: str | None = None@dataclassclass RegionByCodeRequest: code: str@dataclassclass RegionRecord: id: int code: str local_code: str | None name: str continent: str | None iso_country: str wikipedia_link: str | None keywords: str | None@dataclassclass RegionsResponse: regions: list[RegionRecord] total: intIntegration
Fetch region reference data for a selected country and map it into form options.
The example below caches region lists for 24 hours and uses explicit timeouts to keep onboarding forms responsive.
import osimport timefrom dataclasses import dataclassimport requestsHEADERS = { "x-api-key": os.getenv("SKYLINK_API_KEY", "YOUR_API_KEY")}BASE = "https://data.skylinkapi.com/v3"CACHE: dict[str, tuple[dict, float]] = {}REGIONS_TTL = 86_400 # 24 h@dataclassclass RegionOption: code: str label: strdef fetch_regions(*, country: str) -> list[dict]: country = country.upper() key = f"regions:{country}" cached = CACHE.get(key) if cached and time.time() < cached[1]: return cached[0]["regions"] try: r = requests.get( f"{BASE}/regions", headers=HEADERS, params={"country": country}, timeout=(10, 15), ) except requests.Timeout as exc: raise RuntimeError(f"SkyLink timeout fetching regions for {country}") from exc r.raise_for_status() data = r.json() CACHE[key] = (data, time.time() + REGIONS_TTL) return data.get("regions", [])def get_region_by_code(code: str) -> dict | None: code = code.upper() try: r = requests.get(f"{BASE}/regions/{code}", headers=HEADERS, timeout=(10, 15)) except requests.Timeout as exc: raise RuntimeError(f"SkyLink timeout fetching region {code}") from exc if r.status_code == 404: return None r.raise_for_status() return r.json()def region_options(country: str) -> list[RegionOption]: return [RegionOption(code=item["code"], label=item["name"]) for item in fetch_regions(country=country)]if __name__ == "__main__": import json ny = get_region_by_code("US-NY") print(json.dumps(ny, indent=2, default=str))Implementation notes
Country-first UX. Query by country whenever possible — avoid sending the full global list to browsers.
Airport joins. Join airport.iso_region from Airports directly against regions.code.
Code format. Enforce XX-YYY style before request where practical to reduce avoidable 404s.
Error responses
Shared errors: Error Handling. Endpoint-specific:
404 - region not found
{
"detail": "Region 'ZZ-XX' not found"
}Your SkyLink licence key, for keys bought direct from skylinkapi.com.
In: header
Query Parameters
Filter by ISO 3166-1 alpha-2 country code (e.g. US, CA, GB)
Filter by continent code: AF, AN, AS, EU, NA, OC, SA
Response Body
application/json
application/json
curl -X GET "https://data.skylinkapi.com/v3/regions"{
"regions": [
{
"id": 0,
"code": "string",
"local_code": "string",
"name": "string",
"continent": "string",
"iso_country": "string",
"wikipedia_link": "string",
"keywords": "string"
}
],
"total": 0
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Your SkyLink licence key, for keys bought direct from skylinkapi.com.
In: header
Path Parameters
ISO 3166-2 region code (e.g. US-CA, GB-ENG, AU-NSW)
Response Body
application/json
application/json
curl -X GET "https://data.skylinkapi.com/v3/regions/US"{
"id": 0,
"code": "string",
"local_code": "string",
"name": "string",
"continent": "string",
"iso_country": "string",
"wikipedia_link": "string",
"keywords": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Related: Countries · Airports · Airport Search