Skip to main content

Airport codes, routes and aviation data API client — airportfyi.com

Project description

airportfyi

PyPI version Python License: MIT Zero Dependencies

Python API client for global airport data. Look up 4,500+ airports by IATA/ICAO code, query runway specifications, explore terminal configurations, and retrieve geographic coordinates — all from AirportFYI, an airport reference platform with comprehensive data on commercial and regional airports worldwide.

Built on authoritative aviation data sources, AirportFYI covers IATA/ICAO code assignments, airport classifications (international hub, regional, domestic), runway dimensions, elevation, timezone, and country information — used by travel-tech developers, flight tracking apps, and aviation data platforms.

Explore airports at airportfyi.com — browse by country, search by IATA code, and view airport details.

airportfyi demo — airport lookup, IATA/ICAO codes, and route data in Python

Table of Contents

Install

pip install airportfyi                # Core (zero deps)
pip install "airportfyi[cli]"         # + Command-line interface
pip install "airportfyi[mcp]"         # + MCP server for AI assistants
pip install "airportfyi[api]"         # + HTTP client for airportfyi.com API
pip install "airportfyi[all]"         # Everything

Quick Start

from airportfyi.api import AirportFYI

with AirportFYI() as api:
    # Look up airport by IATA code
    icn = api.get_airport("incheon-international")
    print(icn["iata"])           # ICN
    print(icn["icao"])           # RKSI
    print(icn["city"])           # Seoul
    print(icn["country"])        # South Korea

    # List airports by country
    airports = api.list_airports(country="japan")
    for a in airports:
        print(f"{a['iata']}{a['name']}")

    # Search airports globally
    results = api.search("heathrow")

What You Can Do

IATA and ICAO Codes

Every commercial airport is assigned two identification codes. The IATA code (3 letters) is used on boarding passes and booking systems — familiar codes like LAX, JFK, NRT. The ICAO code (4 letters) is used in flight plans and air traffic control — KLAX, KJFK, RJTT. The first letter(s) of ICAO codes indicate the geographic region.

ICAO Prefix Region Examples
K Contiguous United States KJFK, KLAX, KORD
C Canada CYYZ, CYVR
EG United Kingdom EGLL (Heathrow), EGKK (Gatwick)
LF France LFPG (CDG), LFPO (Orly)
RJ Japan (mainland) RJTT (Haneda), RJAA (Narita)
RK South Korea RKSI (Incheon), RKSS (Gimpo)
Z China (mainland) ZBAA (Beijing), ZSPD (Pudong)
WS Singapore WSSS (Changi)
from airportfyi.api import AirportFYI

with AirportFYI() as api:
    # Look up by IATA code
    results = api.search("ICN")
    airport = results[0]
    print(f"{airport['iata']}/{airport['icao']}{airport['name']}")
    # ICN/RKSI — Incheon International Airport

Learn more: Airport Directory · Glossary

Airport Classifications

Airports are classified by traffic volume, runway capability, and role in the air transport network. Major international hubs handle 40M+ passengers annually and serve as connection points for global airline alliances.

Classification Annual Passengers Characteristics
Large Hub 1% + of total (40M+) Multiple terminals, long-haul routes
Medium Hub 0.25-1% (10-40M) Domestic + some international
Small Hub 0.05-0.25% (2-10M) Regional service
Non-Hub Primary 10K-2M Essential air service
Regional/GA <10K General aviation, private
from airportfyi.api import AirportFYI

with AirportFYI() as api:
    # Browse airports by country
    airports = api.list_airports(country="united-states")
    hubs = [a for a in airports if a.get("classification") == "Large Hub"]
    print(f"{len(hubs)} large hub airports in the US")

Learn more: Countries · Guides

Runway and Elevation Data

Runway length determines what aircraft can operate at an airport. Widebody jets (B777, A380) typically require 3,000m+ runways, while regional turboprops can operate from 1,500m. Airport elevation affects takeoff performance — high-altitude airports like La Paz (4,061m) require longer runways due to thinner air.

Runway Category Length Capable Aircraft
Short (<1,500m) 4,921 ft Turboprops, light jets
Medium (1,500-2,500m) 8,202 ft Narrowbody (A320, B737)
Long (2,500-3,500m) 11,483 ft Widebody (B777, A350)
Ultra-long (>3,500m) 11,483+ ft A380, high-altitude ops
from airportfyi.api import AirportFYI

with AirportFYI() as api:
    # Get runway specifications
    airport = api.get_airport("denver-international")
    print(f"Elevation: {airport['elevation_ft']} ft")   # 5,431 ft
    print(f"Runways: {airport['runway_count']}")

Learn more: Airport Details · Glossary

Geographic and Timezone Data

Every airport entry includes precise latitude/longitude coordinates and IANA timezone identifier, enabling distance calculations, flight time estimation, and local time display in travel applications.

from airportfyi.api import AirportFYI

with AirportFYI() as api:
    airport = api.get_airport("tokyo-haneda")
    print(f"Lat: {airport['latitude']}")       # 35.5533
    print(f"Lon: {airport['longitude']}")      # 139.7811
    print(f"Timezone: {airport['timezone']}")   # Asia/Tokyo
    print(f"UTC Offset: {airport['utc_offset']}")

Learn more: Airport Data · API Documentation

Command-Line Interface

pip install "airportfyi[cli]"

airportfyi airport incheon-international     # Airport details
airportfyi search "LAX"                      # Search by IATA/name
airportfyi country japan                     # All airports in Japan
airportfyi countries                         # List all countries

MCP Server (Claude, Cursor, Windsurf)

pip install "airportfyi[mcp]"
{
    "mcpServers": {
        "airportfyi": {
            "command": "uvx",
            "args": ["--from", "airportfyi[mcp]", "python", "-m", "airportfyi.mcp_server"]
        }
    }
}

REST API Client

from airportfyi.api import AirportFYI

with AirportFYI() as api:
    airport = api.get_airport("incheon-international")  # GET /api/v1/airports/incheon-international/
    airports = api.list_airports(country="japan")        # GET /api/v1/airports/?country=japan
    countries = api.list_countries()                     # GET /api/v1/countries/
    results = api.search("heathrow")                    # GET /api/v1/search/?q=heathrow

Example

curl -s "https://airportfyi.com/api/v1/airports/incheon-international/"
{
    "slug": "incheon-international",
    "name": "Incheon International Airport",
    "iata": "ICN",
    "icao": "RKSI",
    "city": "Seoul",
    "country": "South Korea"
}

Full API documentation at airportfyi.com/developers/.

API Reference

Function Description
api.get_airport(slug) Airport details (codes, coordinates, runways)
api.list_airports(country) List airports, optionally filtered by country
api.list_countries() All countries with airport counts
api.get_country(slug) Country details with airport list
api.search(query) Search by name, IATA, or ICAO code

Learn More About Airports

Also Available

Platform Install Link
npm npm install airportfyi npm
MCP uvx --from "airportfyi[mcp]" python -m airportfyi.mcp_server Config

Transport FYI Family

Part of the FYIPedia open-source developer tools ecosystem — airports, airlines, aircraft, and railways.

Package PyPI npm Description
airportfyi PyPI npm 4,500+ airports, IATA/ICAO codes, routes — airportfyi.com
airlinefyi PyPI npm Airlines, fleets, alliances, routes — airlinefyi.com
planefyi PyPI npm Aircraft models, specifications, manufacturers — planefyi.com
trainfyi PyPI npm Railway stations, train routes, rail networks — trainfyi.com

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airportfyi-0.1.1.tar.gz (197.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airportfyi-0.1.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file airportfyi-0.1.1.tar.gz.

File metadata

  • Download URL: airportfyi-0.1.1.tar.gz
  • Upload date:
  • Size: 197.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for airportfyi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7513280f7a9f25f5d357ba708dca1c954e9ecf3ca557e97ae5377fe3ad2953a7
MD5 30261b3890937d9b56ffefac7699c82f
BLAKE2b-256 70e76209368397c64821fbae6c6f37589e012a42de663bfebe94ecd2c188724c

See more details on using hashes here.

File details

Details for the file airportfyi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: airportfyi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for airportfyi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 835cee847cee7b3c591030abebf294546118f5c0fc7b4c8bc2acf3fbe33abf2f
MD5 f5445f05ef4878b5b525be558cb99089
BLAKE2b-256 f442c17a582ecb856e1640186c0e766598a681a28042065ff7945ef43ac03cc5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page