Guide · Node.js · SDK · REST API

IATA Airport Code Validation in Node.js — Lookup, ICAO & Timezone

IATA codes are everywhere — booking engines, baggage systems, flight APIs. Learn how to validate them, resolve airport names, map to ICAO, and get timezone data in a single call.

1. What is an IATA airport code?

An IATA airport code (also called an IATA location identifier) is a three-letter code assigned by the International Air Transport Association to airports and metropolitan areas worldwide. These codes appear on boarding passes, luggage tags, flight status displays, and booking confirmations.

IATA maintains codes for over 9,000 airports globally. The codes are used across the entire aviation ecosystem — from passenger booking systems and GDS platforms (Amadeus, Sabre, Travelport) to baggage routing, cargo manifests, and flight operations.

Some well-known examples: WAW (Warsaw Chopin), JFK (John F. Kennedy, New York), LHR (London Heathrow), NRT (Narita, Tokyo).

ℹ️IATA codes are not always intuitive. ORD stands for Chicago O'Hare (from the old name "Orchard Field"), YYZ is Toronto Pearson (from the Canadian radio beacon prefix), and SVO is Moscow Sheremetyevo. You cannot derive the city or country from the code alone — you need a lookup.

2. IATA vs ICAO

Two coding systems exist for airports. IATA codes are three-letter identifiers used in commercial aviation — ticketing, passenger-facing systems, and travel APIs. ICAO codes are four-letter identifiers used in air traffic control, flight plans, meteorological reports (METARs), and NOTAMs.

AirportIATAICAOCountry
Warsaw ChopinWAWEPWAPoland
John F. KennedyJFKKJFKUnited States
London HeathrowLHREGLLUnited Kingdom
Narita InternationalNRTRJAAJapan
Sydney Kingsford SmithSYDYSSYAustralia

ICAO codes follow a regional prefix system — K for the contiguous United States, EG for the United Kingdom, EP for Poland, RJ for Japan. IATA codes have no such geographic structure.

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

3. Why airport code validation matters

Booking systems

A typo in an airport code can route a passenger to the wrong destination. Validating the code at input time — and showing the resolved airport name for confirmation — prevents costly rebooking and customer frustration.

Baggage routing

Baggage handling systems (BHS) use IATA codes to sort and route luggage across conveyor systems. An invalid or ambiguous code in the Baggage Source Message (BSM) can cause misrouted bags — one of the most common passenger complaints in aviation.

API integrations

Flight data APIs, weather services, and ground transportation platforms all accept IATA codes as input. Sending an invalid code results in errors or empty responses. Validating upfront saves round-trips and improves reliability.

Timezone resolution

Converting flight times between local and UTC requires knowing the airport's timezone. The API returns the IANA timezone identifier (e.g. Europe/Warsaw), eliminating the need for a separate timezone lookup.


4. The right solution: one API call

The IsValid IATA Airport API validates the format, looks up the airport in a directory of 9,000+ entries, and returns name, city, country, ICAO code, timezone, and airport type — all from a single GET request.

Format validation
Checks the code is exactly 3 letters
Directory lookup
Resolves name, city, and country from 9,000+ airports
ICAO mapping
Returns the corresponding 4-letter ICAO code
Timezone
IANA timezone identifier for local time conversion

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

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


5. Node.js code example

Using the @isvalid-dev/sdk package or the native fetch API (Node 18+).

// airportValidator.js
import { createClient } from '@isvalid-dev/sdk';

const iv = createClient({ apiKey: process.env.ISVALID_API_KEY });

// ── Example usage ────────────────────────────────────────────────────────────

const result = await iv.iata.airport('WAW');

if (!result.valid) {
  console.log('Invalid IATA code format');
} else if (!result.found) {
  console.log('Valid format but airport not found in directory');
} else {
  console.log(`${result.name} (${result.iata}/${result.icao})`);
  console.log(`${result.city}, ${result.countryName} · ${result.timezone}`);
  // → Warsaw Chopin Airport (WAW/EPWA)
  // → Warsaw, Poland · Europe/Warsaw
}

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

// airportBatch.js — validate multiple IATA codes sequentially
async function validateAirports(codeList) {
  const results = [];

  for (const code of codeList) {
    try {
      const data = await validateAirport(code);
      results.push({ code, ...data });
    } catch (err) {
      results.push({ code, valid: false, error: err.message });
    }
  }

  return results;
}

// ── Example ──────────────────────────────────────────────────────────────────

const codes = ['WAW', 'JFK', 'LHR', 'XYZ', '123'];
const results = await validateAirports(codes);

for (const r of results) {
  const status = r.valid && r.found ? '✓' : r.valid ? '?' : '✗';
  const name = r.name ?? 'not found';
  console.log(`  ${status}  ${r.code.padEnd(5)}  ${name}`);
}
Airport data changes infrequently. Cache results by IATA code with a TTL of 24 hours to reduce API calls during high-volume lookups. Store the full response so you can serve name, timezone, and ICAO mappings without re-calling the API.

6. cURL example

Warsaw Chopin Airport:

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

Valid format but not found in directory:

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

Invalid format (digits instead of letters):

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

7. Understanding the response

Response for WAW (Warsaw Chopin Airport):

{
  "valid": true,
  "found": true,
  "iata": "WAW",
  "icao": "EPWA",
  "name": "Warsaw Chopin Airport",
  "city": "Warsaw",
  "countryCode": "PL",
  "countryName": "Poland",
  "timezone": "Europe/Warsaw",
  "type": "large_airport"
}

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 3-letter format
foundbooleanWhether the code was found in the airport directory (only present when valid is true)
iatastringNormalised 3-letter IATA code (uppercase)
icaostringCorresponding 4-letter ICAO code
namestringFull airport name
citystringCity the airport serves
countryCodestringISO 3166-1 alpha-2 country code
countryNamestringFull English country name
timezonestringIANA timezone identifier (e.g. Europe/Warsaw)
typestringAirport type (e.g. large_airport, medium_airport, small_airport)

8. Edge cases to handle

(a) Valid format but not in directory

A code like XYZ is syntactically valid (three letters) but may not correspond to any airport. The API returns valid: true, found: false. Always check both fields before using the enriched data.

const result = await iv.iata.airport('XYZ');

if (!result.valid) {
  // Format is wrong (e.g. digits, wrong length)
  console.log('Invalid IATA code format');
} else if (!result.found) {
  // Format OK, but no matching airport
  console.log('Airport code not recognised');
} else {
  // Safe to use result.name, result.icao, etc.
  console.log(result.name);
}

(b) Closed airports

Some IATA codes belong to airports that have been permanently closed or replaced. For example, THF (Berlin Tempelhof) was closed in 2008, and TXL (Berlin Tegel) closed in 2020. These codes may still appear in the directory for historical reference. If your use case requires only active airports, check the type field and your own business rules to filter accordingly.

(c) City codes vs airport codes

IATA assigns codes to both individual airports and metropolitan areas. For example, New York City has the city code NYC, but the individual airports are JFK, EWR, and LGA. Similarly, London has LON as a city code with LHR, LGW, STN, LTN, and others as airport codes.

⚠️If your system requires a specific airport (for gate assignments, ground transport, or baggage routing), make sure users provide an airport code rather than a city code. A city code is valid but does not resolve to a single physical airport.

(d) Case insensitivity

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

// All of these return the same result
const r1 = await iv.iata.airport('waw');
const r2 = await iv.iata.airport('Waw');
const r3 = await iv.iata.airport('WAW');

console.log(r1.iata); // → "WAW"
console.log(r2.iata); // → "WAW"
console.log(r3.iata); // → "WAW"

9. Summary

Validate both format and directory presence — check valid and found
Use the ICAO field when integrating with ATC or flight-plan systems
Use the timezone field for local time conversion — no separate lookup needed
Handle city codes (NYC, LON) separately from airport codes (JFK, LHR)
Cache results — airport data changes infrequently
Accept any case — the API normalises to uppercase automatically

See also

Validate IATA airport codes instantly

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