SoonOne MCP server, all 49 APIs as agent tools. See how it works

Airports & airlines reference data, served from the edge in milliseconds

Aviation API

The Aviation API gives you instant, reliable access to a curated database of ~7,900 IATA-coded commercial airports and ~5,300 airlines worldwide. Resolve any airport by its IATA (3-letter) or ICAO (4-letter) code, or any airline by its IATA (2-letter) or ICAO (3-letter) code — all case-insensitive, with sensible fallbacks so you get a hit even when you only have one of the two code systems.

Beyond simple lookups, the API does the geospatial work for you: the nearest-airports endpoint runs a great-circle (haversine) calculation across the entire dataset and returns the closest airports to any latitude/longitude, each annotated with a precise distance_km. Powerful partial-text search lets you build typeahead pickers, booking flows, flight trackers and logistics dashboards without shipping a multi-megabyte dataset in your own bundle.

Free tier included, no credit card required. One key works across all 49 APIs.

At a glance
Airports
7,900+
Airlines
5,300+
Response Time
<50ms

Key features

  • Airport lookup by IATA (3-letter) or ICAO (4-letter) code, case-insensitive
  • Airline lookup by IATA (2-letter) or ICAO (3-letter) code, case-insensitive
  • Partial search across airport name, city, IATA and ICAO
  • Partial search across airline name, callsign, IATA and ICAO
  • Nearest-airport search by lat/lon with great-circle distance_km
  • Country and city filters with a configurable limit (default 20, max 100)
  • Bundled, read-only datasets with strict input validation and clean 400/404 errors

Built for

  • Airport and airline typeahead pickers in booking flows
  • Flight trackers and aviation dashboards
  • Logistics and freight routing applications
  • Travel and itinerary planning apps
  • Resolving IATA/ICAO codes to human-readable names
  • Finding the closest airport to a user or shipment location
  • Enriching flight or ticket records with airport metadata
  • Mapping and geospatial visualizations of air routes

Try it

Build the request for your data

Edit the parameters below and see the exact curl command and JSON response you will get. No key required to preview.

GET/aviation/v1/airports/JFK
Open in Playground

Parameters

Request · HTTP
GET /aviation/v1/airports/JFK?apikey=YOUR_KEY HTTP/1.1
Host: api.apicodex.io
Response · JSON
200 OK
{
"airport": {
  "icao": "KJFK",
  "iata": "JFK",
  "name": "John F Kennedy International Airport",
  "city": "New York",
  "state": "New York",
  "country": "US",
  "lat": 40.639751,
  "lon": -73.778925,
  "elevation": 13,
  "tz": "America/New_York"
}
}

Documentation

Aviation API Documentation

The Aviation API provides edge-served reference data for airports and airlines. Look up airports by IATA or ICAO code, search by name/city/country, find the nearest airports to any coordinate via great-circle (haversine) distance, and resolve airlines by IATA or ICAO code. All datasets are bundled and read-only, with strict input validation.

Base URL

url
https://api.apicodex.io

Authentication

Authenticate every request by passing your API key as the ?apikey= query parameter:

headers
GET /aviation/v1/airports/JFK?apikey=YOUR_KEY

Request and response

Illustrative values. Confirm current endpoint behavior, quotas, and data freshness in the API documentation before production use.

request · http
GET /aviation/v1/airports/JFK?apikey=YOUR_KEY HTTP/1.1
response · json
{
"airport": {
  "icao": "KJFK",
  "iata": "JFK",
  "name": "John F Kennedy International Airport",
  "city": "New York",
  "state": "New York",
  "country": "US",
  "lat": 40.639751,
  "lon": -73.778925,
  "elevation": 13,
  "tz": "America/New_York"
}
}

Code examples

cURL
curl --request GET \
  --url 'https://api.apicodex.io/aviation/v1/airports/nearest?lat=40.71&lon=-74.0&limit=2&apikey=YOUR_KEY'

Endpoints

GET /aviation/v1/airports/{code}

Look up a single airport by 3-letter IATA or 4-letter ICAO code (case-insensitive).

/aviation/v1/airports/JFK?apikey=YOUR_KEY

GET /aviation/v1/airports/search

Partial, case-insensitive search over airport name, city, IATA and ICAO, with optional country/city filters.

/aviation/v1/airports/search?q=kennedy&country=US&apikey=YOUR_KEY

GET /aviation/v1/airports/nearest

Returns airports nearest to a lat/lon point, sorted by great-circle (haversine) distance with distance_km.

/aviation/v1/airports/nearest?lat=40.71&lon=-74.0&limit=2&apikey=YOUR_KEY

GET /aviation/v1/airlines/{code}

Look up a single airline by 2-letter IATA or 3-letter ICAO code (case-insensitive).

/aviation/v1/airlines/AAL?apikey=YOUR_KEY

GET /aviation/v1/airlines/search

Partial, case-insensitive search over airline name, IATA, ICAO and callsign, with optional country/active filters.

/aviation/v1/airlines/search?q=american&active=true&apikey=YOUR_KEY

Query Parameters

Required parameters

  • apikey Your API key, passed as a query parameter on every request.
  • code Path parameter for the lookup endpoints: a 3/4-character airport code or 2/3-character airline code.
  • lat Latitude in decimal degrees (-90 to 90). Required for the nearest endpoint.
  • lon Longitude in decimal degrees (-180 to 180). Required for the nearest endpoint.

Optional parameters

  • q Partial match against name/city/IATA/ICAO (airports) or name/IATA/ICAO/callsign (airlines).
  • country Exact country filter (ISO code for airports, country name for airlines), case-insensitive.
  • city Partial city match for airport search (case-insensitive).
  • active Filter airlines by active status. Accepts true/1 or false/0.
  • limit Maximum results to return for list endpoints. Default 20, max 100.

Pricing

Aviation API Pricing

One key, one subscription, all 49 APIs. Start free and upgrade when you grow. No minimums, no lock-in.

This API costs 1 credit per request. Credits are shared across every API on your plan.

Estimate your monthly cost

Drag the slider to match your expected request volume. We will recommend the cheapest plan that covers it.

10,000

Recommended plan

Starter

$29.99 /month

Credits used10,000
Credits included50,000
Cost per 1K requests$0.600
Choose Starter

Free

Free
1,000 credits · ~1,000 requests/mo · 2 rps
  • All 49 APIs included
  • No credit card required
  • Full documentation and examples
Start for free

Starter

Popular
$29.99/month
50,000 credits · ~50,000 requests/mo · 10 rps
  • All 49 APIs included
  • Email support
  • Usage dashboard and analytics
Start with Starter

Pro

$99.99/month
250,000 credits · ~250,000 requests/mo · 25 rps
  • All 49 APIs included
  • Priority support
  • Up to 5 API keys
Start with Pro

Need a different plan?

Tell us about your API, volume, or support requirements.

Contact us

Coming soon · MCP

Use the Aviation API from your AI agent

The API Codex MCP server will expose this API, and the other 39, to Claude, Cursor and any MCP client as tools. Same key, same credits, one config entry.

About the MCP server

FAQ

Frequently asked questions

The API includes approximately 7,900 IATA-coded commercial/passenger airports and approximately 5,300 airlines worldwide. Airports are limited to those with an assigned IATA code, so general-aviation airfields and heliports without an IATA code are not included. Airline IATA codes are populated only where known — many airline records carry only an ICAO/primary code — so you should handle null code fields in your integration.

Yes. For airports, a 3-character code resolves IATA first then ICAO, and a 4-character code resolves ICAO first then IATA. For airlines, a 2-character code resolves IATA first and a 3-character code resolves ICAO first with a fallback to the source primary-key map. All code matching is case-insensitive, so 'jfk' and 'JFK', or 'aal' and 'AAL', return the same result.

Send a lat and lon (in decimal degrees, latitude -90 to 90 and longitude -180 to 180) to /aviation/v1/airports/nearest. The API computes the great-circle (haversine) distance from that point to every airport in the dataset and returns the closest airports sorted ascending by distance. Each result includes a precise distance_km value, and the response echoes your origin coordinate. Use the optional limit parameter (default 20, max 100) to control how many airports are returned.

Pass your API key as the ?apikey= query parameter on every request, for example /aviation/v1/airports/JFK?apikey=YOUR_KEY. An X-Api-Key header works just as well. Your plan governs your monthly credit allowance and rate limit.

Yes. The Basic tier is free with 1,000 requests per month and a 5 req/s rate limit, ideal for prototyping and evaluation. The Pro tier ($12/month) includes 100,000 requests per month at 20 req/s, and the Ultra tier ($49/month) includes 1,000,000 requests per month at 50 req/s. All tiers include the full airport and airline datasets and every endpoint.

The API returns clean, predictable errors. A 400 is returned for a missing or malformed code, when a search endpoint is called without at least one filter (q, country, or city/active), or when lat/lon are missing, non-numeric or out of range. A 404 is returned when no airport or airline matches the supplied code. Each error response contains a descriptive 'error' message you can surface or log.

Absolutely. The partial, case-insensitive search endpoints are designed for this. For airports, query the q parameter against name/city/IATA/ICAO and optionally filter by country or city; for airlines, query q against name/IATA/ICAO/callsign. Request a small limit (for example 10–20) and debounce user input so responses stay fast. Because the data is edge-served and read-only, typical responses return in well under 50ms.