Guide · Python · SDK · REST API

IATA Airline Code Validation in Python — Lookup, ICAO & Callsign

IATA airline designator codes power booking systems, e-tickets, and baggage tags worldwide. Learn how to validate them, resolve airline names, map to ICAO codes, and retrieve callsign and country data in a single API call.

1. What are IATA airline codes?

An IATA airline designator is a two-character code assigned by the International Air Transport Association to airlines operating scheduled and charter services. These codes are the backbone of commercial aviation — they appear on flight numbers, booking references, e-tickets, baggage tags, and interline agreements.

IATA designators consist of two alphanumeric characters. Most are two letters, but some include a digit — for example, 2K (Avianca Ecuador). The codes are unique to each operating airline and are essential for ticketing, baggage handling, and revenue accounting between carriers.

Some well-known examples: AA (American Airlines), BA (British Airways), LH (Lufthansa), LO (LOT Polish Airlines).

ℹ️IATA airline codes are not always intuitive. DL is Delta Air Lines (not the letters in "Delta"), QF is Qantas (Q was already taken when IATA assigned codes), and EK is Emirates. You cannot derive the airline name from the code alone — you need a lookup.

2. IATA vs ICAO airline codes

Two coding systems exist for airlines. IATA designators are two-character codes used in commercial aviation — ticketing, passenger-facing systems, GDS platforms, and baggage routing. ICAO designators are three-letter codes used in air traffic control, flight plans, and operational communications between ATC and pilots.

AirlineIATAICAOCallsign
American AirlinesAAAALAMERICAN
British AirwaysBABAWSPEEDBIRD
LufthansaLHDLHLUFTHANSA
LOT Polish AirlinesLOLOTLOT
EmiratesEKUAEEMIRATES

Passengers see IATA codes on boarding passes and flight displays (e.g. AA 100), while pilots and ATC use ICAO codes and callsigns on the radio (e.g. "American One Hundred" with ICAO prefix AAL). The two systems do not follow a predictable mapping — you need a lookup to convert between them.

The IsValid IATA airline API returns both codes. Send an IATA code and get the corresponding ICAO code and callsign in the response — no need to maintain a separate mapping table.

3. The right solution: one API call

The IsValid IATA Airline API validates the format, looks up the airline in a comprehensive directory, and returns name, ICAO code, callsign, and country — all from a single GET request.

Format validation
Checks the code is a valid 2-character IATA designator
Directory lookup
Resolves airline name and country from the IATA registry
ICAO mapping
Returns the corresponding 3-letter ICAO designator
Callsign
ATC radio callsign used in flight operations

Get your free API key at isvalid.dev — 100 calls per day, no credit card required.

Full parameter reference and response schema: IATA Airline Validation API docs →


4. Python code example

Using the isvalid SDK package or the requests library.

# airline_validator.py
import os
from isvalid import IsValid

iv = IsValid(api_key=os.environ["ISVALID_API_KEY"])

# ── Validate a single airline ───────────────────────────────────────────────

result = iv.iata.airline("AA")
print(result["valid"])        # True
print(result["found"])        # True
print(result["name"])         # 'American Airlines'
print(result["icao"])         # 'AAL'
print(result["callsign"])     # 'AMERICAN'
print(result["countryCode"])  # 'US'

# ── List all airlines ───────────────────────────────────────────────────────

airlines = iv.iata.airline_list()
print(f"Total airlines: {len(airlines)}")

For batch validation — processing a list of airline codes from a schedule or import file:

# airline_batch.py — validate multiple IATA airline codes
from typing import Any


def validate_airlines(code_list: list[str]) -> list[dict[str, Any]]:
    """Validate a list of IATA airline codes and return enriched results."""
    results = []

    for code in code_list:
        try:
            data = validate_airline(code)
            results.append({"code": code, **data})
        except Exception as exc:
            results.append({"code": code, "valid": False, "error": str(exc)})

    return results


# ── Example ──────────────────────────────────────────────────────────────────

codes = ["AA", "BA", "LH", "XX", "00"]
results = validate_airlines(codes)

for r in results:
    if r.get("valid") and r.get("found"):
        status = "✓"
    elif r.get("valid"):
        status = "?"
    else:
        status = "✗"
    name = r.get("name", "not found")
    print(f"  {status}  {r['code']:<5}  {name}")
Airline data changes infrequently. Cache results by IATA code with a TTL of 24 hours to reduce API calls during high-volume lookups. Use functools.lru_cache for simple in-process caching, or Redis for multi-process deployments.

5. cURL example

American Airlines:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/iata/airline?value=AA"

Valid format but not found in directory:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/iata/airline?value=XX"

List all airlines:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/iata/airline/list"

6. Understanding the response

Response for AA (American Airlines):

{
  "valid": true,
  "found": true,
  "iata": "AA",
  "name": "American Airlines",
  "icao": "AAL",
  "callsign": "AMERICAN",
  "countryCode": "US",
  "countryName": "United States"
}

Response for a valid format that is not in the directory:

{
  "valid": true,
  "found": false
}

Response for an invalid code:

{
  "valid": false
}
FieldTypeDescription
validbooleanWhether the code has a valid 2-character IATA format
foundbooleanWhether the code was found in the airline directory (only present when valid is true)
iatastringNormalised 2-character IATA airline code (uppercase)
namestringFull airline name
icaostring | nullCorresponding 3-letter ICAO designator (null if not assigned)
callsignstring | nullATC radio callsign (null if not assigned)
countryCodestringISO 3166-1 alpha-2 country code of the airline's registration
countryNamestring | nullFull English country name

7. Edge cases to handle

(a) Codeshare flights

A single physical flight can be marketed under multiple airline codes through codeshare agreements. For example, a flight operated by American Airlines (AA) may also be sold as a British Airways (BA) or Iberia (IB) flight. Each airline code is independently valid — the API validates the marketing carrier's code regardless of who operates the aircraft.

⚠️If your system needs to identify the operating carrier (the airline that actually flies the aircraft), you cannot rely solely on the IATA code from the ticket. Use the operating carrier field from the booking record (PNR) or flight schedule data.

(b) Defunct airlines

Airlines cease operations regularly. Codes from defunct airlines may be reassigned to new carriers after a waiting period. For example, the code NW belonged to Northwest Airlines (merged with Delta in 2010). The API returns the current holder of the code. If you are processing historical data, be aware that the same code may have referred to a different airline in the past.

(c) Numeric codes like 2K

IATA airline codes can contain digits. Codes like 2K, 3K, and 9W are perfectly valid. A simple "letters only" regex will reject these codes. The API handles all valid IATA designator formats, including alphanumeric combinations.

# These are all valid IATA airline codes
codes = ["AA", "2K", "3K", "9W", "U2"]

for code in codes:
    result = iv.iata.airline(code)
    name = result["name"] if result["found"] else "not found"
    print(f"{code}: {name}")

(d) Case insensitivity

The API accepts codes in any case — aa, Aa, and AA all return the same result. The response always returns the normalised uppercase form in the iata field.

# All of these return the same result
r1 = iv.iata.airline("aa")
r2 = iv.iata.airline("Aa")
r3 = iv.iata.airline("AA")

print(r1["iata"])  # → "AA"
print(r2["iata"])  # → "AA"
print(r3["iata"])  # → "AA"

8. Summary

Validate both format and directory presence — check valid and found
Use the ICAO field when integrating with ATC or flight-plan systems
Handle alphanumeric codes (2K, 9W) — not all designators are letters only
Be aware of codeshare flights — the marketing carrier may differ from the operator
Cache results — airline data changes infrequently
Accept any case — the API normalises to uppercase automatically

See also

Validate IATA airline codes instantly

Free tier includes 100 API calls per day. No credit card required. Airline name, ICAO code, callsign, and country lookup included in every response.