Save up to 17% with yearly billing

See pricing

Regionen

Regionale Untergliederungen nach ISO 3166-2 (Bundesstaaten, Provinzen, Territorien). Der wichtigste Integrationsweg ist die Auflösung von iso_region aus Flughäfen in eine lesbare Bezeichnung — zum Beispiel US-NY → New York. Zwei Operationen: Regionen auflisten (gefiltert nach Land oder Kontinent) und eine einzelne Region per Code abrufen.

Filtern Sie, wann immer möglich. Eine ungefilterte Liste liefert weltweit ca. 3.900 Zeilen. Übergeben Sie in produktiven UIs country oder continent.

EndpointEinsatzzweck
GET /regionsRegionsauswahl, gefiltert nach Land oder Kontinent
GET /regions/{code}iso_region aus einem Flughafendatensatz auflösen

Regionen auflisten

Liefert Regionen, optional gefiltert nach Land und/oder Kontinent.

Anfrage

Voraussetzungen

Auth
x-api-key bei jeder Anfrage (Direktabonnement). Mehr erfahren →
GEThttps://data.skylinkapi.com/v3.1/regions
ParameterTypErforderlichStandardBeschreibung
countrystringNeinalle LänderLändercode nach ISO 3166-1 alpha-2, z. B. US
continentstringNeinalle KontinenteKontinentcode (AF, AN, AS, EU, NA, OC, SA)

Antwort

{
  "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
}
FeldTypErforderlichNull?Beschreibung
regionsarrayJaNiePassende Regionsdatensätze
totalintegerJaNieAnzahl der zurückgegebenen Regionen

Regionseintrag (regions[])

FeldTypErforderlichNull?Beschreibung
idintegerJaNieNumerische Datensatzkennung
codestringJaNieISO-3166-2-Regionscode, z. B. US-NY
local_codestring | nullNeinJaLandesinterner Kurzcode (z. B. NY)
namestringJaNieName der Region
continentstring | nullNeinJaKontinentcode, sofern zugeordnet
iso_countrystringJaNieAlpha-2-Code des übergeordneten Landes
wikipedia_linkstring | nullNeinJaReferenz-URL
keywordsstring | nullNeinJaFreitext-Tags

Region per Code abrufen

Rufen Sie eine einzelne Region per ISO 3166-2-Code ab (z. B. US-CA, GB-ENG). Liefert 404, wenn der Code nicht gefunden wird.

Anfrage

GEThttps://data.skylinkapi.com/v3.1/regions/{code}
ParameterTypErforderlichBeschreibung
codestringJaPfadparameter mit dem ISO-3166-2-Regionscode

Antwort

{
  "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"
}

Gleiche Objektstruktur wie bei den Listeneinträgen. Listenfilter ohne Treffer liefern regions: [] und total: 0 — keinen Fehler.

Client-Typen

"""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: int

Integration

Rufen Sie Regionsreferenzdaten für ein ausgewähltes Land ab und bilden Sie sie auf Formularoptionen ab.

Das folgende Beispiel speichert Regionslisten 24 Stunden lang im Cache und verwendet explizite Timeouts, damit Onboarding-Formulare reaktionsschnell bleiben.

import osimport timefrom dataclasses import dataclassimport requestsHEADERS = {    "x-api-key": os.getenv("SKYLINK_API_KEY", "YOUR_API_KEY")}BASE = "https://data.skylinkapi.com/v3.1"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))

Hinweise zur Implementierung

Land zuerst (UX). Fragen Sie nach Möglichkeit per country ab — vermeiden Sie es, die vollständige globale Liste an Browser zu senden.

Verknüpfung mit Flughäfen. Verknüpfen Sie airport.iso_region aus Flughäfen direkt mit regions.code.

Codeformat. Erzwingen Sie nach Möglichkeit schon vor der Anfrage das Format XX-YYY, um vermeidbare 404-Fehler zu reduzieren.

Fehlerantworten

Allgemeine Fehler: Fehlerbehandlung. Endpoint-spezifisch:

404 - Region nicht gefunden

{
  "detail": "Region 'ZZ-XX' not found"
}
GET
/regions
x-api-key<token>

Your SkyLink licence key, for keys bought direct from skylinkapi.com.

In: header

Query Parameters

country?|

Filter by ISO 3166-1 alpha-2 country code (e.g. US, CA, GB)

continent?|

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.1/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": {}
    }
  ]
}
GET
/regions/{code}
x-api-key<token>

Your SkyLink licence key, for keys bought direct from skylinkapi.com.

In: header

Path Parameters

code*Code

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.1/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": {}
    }
  ]
}

Siehe auch: Länder · Flughäfen · Flughafensuche