Airport Search
Three discovery modes help users find an airport before you fetch full records from Airports: typeahead by name or code, nearest airports to a map pin or GPS fix, and nearest airports inferred from a visitor IP. All three return the same core airport item schema; location and IP modes add distance_km.
| Endpoint | When to use |
|---|---|
GET /airports/search/text | Autocomplete — user types a name, city, or partial code |
GET /airports/search/location | Map pin or GPS coordinates — airports within a radius |
GET /airports/search/ip | "Airports near me" without browser geolocation permission |
Search by text
Free-text search across ICAO codes, IATA codes, airport names, and cities. Results are ranked by relevance_score — exact code matches score highest.
Request
Requirements
x-api-key on every request (direct subscription). Learn more →https://data.skylinkapi.com/v3/airports/search/text| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
q | string | Yes | - | Search string — minimum 2 characters |
limit | integer | No | 10 | Maximum results to return |
Response
{
"query": "jfk",
"airports": [
{
"id": 3622,
"ident": "KJFK",
"type": "large_airport",
"name": "John F. Kennedy International Airport",
"latitude_deg": 40.639447,
"longitude_deg": -73.779317,
"municipality": "New York",
"iso_country": "US",
"iata_code": "JFK",
"relevance_score": 100
}
],
"airports_found": 1
}| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Echo of the search string |
airports | array | Yes | Ranked matches (may be empty) |
airports_found | integer | Yes | Count of items in airports |
Airport item (airports[])
| Field | Type | Required | Null? | Description |
|---|---|---|---|---|
ident | string | Yes | Never | Primary identifier (usually ICAO) |
name | string | Yes | Never | Airport name |
type | string | Yes | Never | Airport class (same values as Airports) |
latitude_deg | number | Yes | Never | WGS-84 latitude |
longitude_deg | number | Yes | Never | WGS-84 longitude |
municipality | string | null | No | Yes | City served |
iso_country | string | null | No | Yes | ISO country code |
iata_code | string | null | No | Yes | IATA code when assigned |
relevance_score | integer | Yes | Never | Higher = better match (100 = exact code hit) |
Your SkyLink licence key, for keys bought direct from skylinkapi.com.
In: header
Query Parameters
Search query
2 <= length <= 100Maximum results to return
201 <= value <= 100Filter by airport type
"large_airport" | "medium_airport" | "small_airport" | "heliport" | "seaplane_base" | "closed" | "balloonport"Response Body
application/json
application/json
curl -X GET "https://data.skylinkapi.com/v3/airports/search/text?q=string"{
"query": "London",
"airports": [
{
"ident": "EGLL",
"type": "large_airport",
"name": "London Heathrow Airport",
"latitude_deg": 51.4706,
"longitude_deg": -0.4619,
"municipality": "London",
"iso_country": "GB",
"iata_code": "LHR",
"relevance_score": 80
}
],
"airports_found": 1
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Search by location
Returns airports within a radius of a coordinate, sorted nearest-first. Each result includes distance_km.
Request
Requirements
x-api-key on every request (direct subscription). Learn more →https://data.skylinkapi.com/v3/airports/search/location| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
lat | number | Yes | - | Latitude (-90 to 90, decimal degrees WGS-84) |
lon | number | Yes | - | Longitude (-180 to 180, decimal degrees WGS-84) |
radius | number | No | 50 | Search radius in kilometres (must be > 0) |
type | string | No | all types | Filter by airport type, e.g. large_airport |
Returns up to 50 airports. Heliports and closed fields may appear near dense urban areas unless you pass type.
Response
{
"search_location": {
"latitude": 40.64,
"longitude": -73.78,
"radius_km": 50.0,
"type_filter": null
},
"airports": [
{
"ident": "KJFK",
"name": "John F. Kennedy International Airport",
"type": "large_airport",
"latitude_deg": 40.639447,
"longitude_deg": -73.779317,
"municipality": "New York",
"iso_country": "US",
"iata_code": "JFK",
"distance_km": 0.08
}
],
"airports_found": 42
}| Field | Type | Required | Description |
|---|---|---|---|
search_location | object | Yes | Echo of query parameters |
airports | array | Yes | Distance-sorted matches |
airports_found | integer | Yes | Count returned (≤ 50) |
Airport item (airports[])
Same core fields as text search, plus distance_km (great-circle distance from the query point in kilometres).
Your SkyLink licence key, for keys bought direct from skylinkapi.com.
In: header
Query Parameters
Latitude in decimal degrees
-90 <= value <= 90Longitude in decimal degrees
-180 <= value <= 180Search radius in kilometers
500 < value <= 500Filter by airport type
"large_airport" | "medium_airport" | "small_airport" | "heliport" | "seaplane_base" | "closed" | "balloonport"Maximum results to return
501 <= value <= 200Response Body
application/json
application/json
curl -X GET "https://data.skylinkapi.com/v3/airports/search/location?lat=-90&lon=-180"{
"search_location": {
"latitude": 40.64,
"longitude": -73.78,
"radius_km": 50
},
"airports": [
{
"id": 3682,
"ident": "KJFK",
"type": "large_airport",
"name": "John F Kennedy International Airport",
"latitude_deg": 40.6398,
"longitude_deg": -73.7789,
"elevation_ft": 13,
"municipality": "New York",
"iso_country": "US",
"iso_region": "US-NY",
"iata_code": "JFK",
"distance_km": 0.15
}
],
"airports_found": 1
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Search by IP
Geolocates an IP address and returns nearby airports using the same distance-sorted list as location search.
Request
Requirements
x-api-key on every request (direct subscription). Learn more →https://data.skylinkapi.com/v3/airports/search/ip| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ip | string | No | caller IP | IPv4/IPv6 to geolocate. Omit to use the requester's IP (RapidAPI forwards the client address) |
radius | number | No | 50 | Search radius in kilometres |
Omit ip for server-side "airports near me" when RapidAPI receives the end-user IP. Pass the visitor IP explicitly when your backend proxies requests.
Response
{
"ip_address": "203.0.113.10",
"location": {
"latitude": 40.7128,
"longitude": -74.006,
"city": "New York",
"region": "New York",
"country": "United States",
"country_code": "US"
},
"search_radius_km": 50.0,
"airports": [
{
"ident": "KJFK",
"name": "John F. Kennedy International Airport",
"distance_km": 20.5
}
],
"airports_found": 38
}| Field | Type | Required | Null? | Description |
|---|---|---|---|---|
ip_address | string | Yes | Never | IP that was geolocated |
location | object | null | No | Yes | Resolved geolocation; null when lookup fails |
search_radius_km | number | Yes | Never | Applied search radius |
airports | array | Yes | Never | Distance-sorted airports (same shape as location search) |
airports_found | integer | Yes | Never | Count returned |
error | string | null | No | Yes | Error message when geolocation fails |
Accuracy note. Residential IPs resolve to city level; VPN and data-center IPs may be inaccurate. Show the resolved city and let the user override.
Your SkyLink licence key, for keys bought direct from skylinkapi.com.
In: header
Query Parameters
IP address to geolocate (defaults to requester's IP)
Search radius in kilometers
1000 < value <= 500Filter by airport type
"large_airport" | "medium_airport" | "small_airport" | "heliport" | "seaplane_base" | "closed" | "balloonport"Maximum results to return
501 <= value <= 200Response Body
application/json
application/json
curl -X GET "https://data.skylinkapi.com/v3/airports/search/ip"{
"ip_address": "8.8.8.8",
"location": {
"latitude": 37.751,
"longitude": -97.822,
"city": "Wichita",
"region": "Kansas",
"country": "United States",
"country_code": "US",
"postal": "67202",
"timezone": "America/Chicago",
"ip": "8.8.8.8"
},
"airports": [],
"search_radius_km": 100,
"airports_found": 0
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Client types
"""Text search response types - matches airport-search.mdx field tables."""from __future__ import annotationsfrom dataclasses import dataclass@dataclassclass TextSearchRequest: q: str limit: int = 10@dataclassclass TextSearchAirport: ident: str name: str type: str latitude_deg: float longitude_deg: float municipality: str | None iso_country: str | None iata_code: str | None relevance_score: int@dataclassclass TextSearchResponse: query: str airports: list[TextSearchAirport] airports_found: int@dataclassclass LocationSearchRequest: lat: float lon: float radius: float = 50.0 type: str | None = None@dataclassclass LocationAirport: ident: str name: str type: str latitude_deg: float longitude_deg: float municipality: str | None iso_country: str | None iata_code: str | None distance_km: float@dataclassclass LocationSearchResponse: search_location: dict airports: list[LocationAirport] airports_found: int@dataclassclass AirportSuggestion: """Shape returned by autocomplete_suggestions() in the text-search example.""" icao: str | None iata: str | None name: str municipality: str | None country: str | None relevance_score: intIntegration
Power an airport autocomplete field with ranked text search results.
The example below caches text-search responses for one hour and uses connect/read timeouts so typing in a search box cannot hang your UI.
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]] = {}TEXT_SEARCH_TTL = 3600 # 1 h - airport names/codes are stable@dataclassclass AirportSuggestion: icao: str | None iata: str | None name: str municipality: str | None country: str | None relevance_score: intdef search_airports_text(query: str, limit: int = 10) -> dict: cache_key = f"text:{query.lower()}:{limit}" cached = CACHE.get(cache_key) if cached and time.time() < cached[1]: return cached[0] r = requests.get( f"{BASE}/airports/search/text", headers=HEADERS, params={"q": query, "limit": limit}, timeout=(10, 15), ) r.raise_for_status() data = r.json() CACHE[cache_key] = (data, time.time() + TEXT_SEARCH_TTL) return datadef autocomplete_suggestions(query: str, limit: int = 8) -> list[AirportSuggestion]: payload = search_airports_text(query, limit=limit) out: list[AirportSuggestion] = [] for row in payload.get("airports", []): out.append( AirportSuggestion( icao=row.get("ident"), iata=row.get("iata_code"), name=row["name"], municipality=row.get("municipality"), country=row.get("iso_country"), relevance_score=int(row.get("relevance_score") or 0), ) ) return outif __name__ == "__main__": import json result = search_airports_text("JFK", limit=5) print(json.dumps(result, indent=2, default=str))Implementation notes
Debounce user input. Wait ~300 ms after the last keystroke before calling the API. Require at least 2 characters to avoid 422 validation errors.
Relevance ranking. relevance_score: 100 indicates an exact ICAO/IATA match — pin those to the top of autocomplete lists.
Filter airport types. For airline apps, filter to large_airport / medium_airport after fetch, or pass type=large_airport on location search.
Chain to full lookup. After selection, call Airports with icao for runways and frequencies.
IP search privacy. Disclose IP geolocation in your privacy policy. Prefer browser geolocation + location search when the user grants permission.
Error responses
Shared validation and platform errors: Error Handling. Endpoint-specific:
422 - text query too short
{
"detail": [
{
"type": "string_too_short",
"loc": ["query", "q"],
"msg": "String should have at least 2 characters"
}
]
}GeoIP lookup failed (IP search)
When IP geolocation fails, the API returns HTTP 200 with location: null, airports: [], and a populated error string. Treat this as a soft failure — prompt for manual entry or fall back to browser geolocation.
{
"ip_address": "203.0.113.10",
"location": null,
"search_radius_km": 50.0,
"airports": [],
"airports_found": 0,
"error": "Unable to geolocate IP address"
}