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.
In this guide
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).
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.
| Airport | IATA | ICAO | Country |
|---|---|---|---|
| Warsaw Chopin | WAW | EPWA | Poland |
| John F. Kennedy | JFK | KJFK | United States |
| London Heathrow | LHR | EGLL | United Kingdom |
| Narita International | NRT | RJAA | Japan |
| Sydney Kingsford Smith | SYD | YSSY | Australia |
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.
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.
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}`); }
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 }
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether the code has a valid 3-letter format |
| found | boolean | Whether the code was found in the airport directory (only present when valid is true) |
| iata | string | Normalised 3-letter IATA code (uppercase) |
| icao | string | Corresponding 4-letter ICAO code |
| name | string | Full airport name |
| city | string | City the airport serves |
| countryCode | string | ISO 3166-1 alpha-2 country code |
| countryName | string | Full English country name |
| timezone | string | IANA timezone identifier (e.g. Europe/Warsaw) |
| type | string | Airport 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.
(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
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.