airlines.dat) and JSON (airlines.json) formats. This page documents the structure and fields used throughout the package.
File Formats
The package includes two data files:| File | Format | Purpose | Source |
|---|---|---|---|
airlines.dat | CSV | Intermediate format with corrections applied | OpenFlights.org |
airlines.json | JSON | Final format consumed by the npm package | Generated from airlines.dat |
Most users will interact with
airlines.json through the package API. The CSV file is primarily used during the data update pipeline.JSON Structure
Theairlines.json file contains an array of airline objects. Here’s an example:
Field Definitions
Each airline record contains 8 fields:id
Unique OpenFlights airline identifier. This ID is stable across updates and used for referencing specific corrections in
normalize.js."24", "137", "439"
The ID is stored as a string in JSON for consistency with the CSV format, even though it represents a numeric identifier.
name
Full official name of the airline.
"American Airlines""Air France""Private flight"
alias
Alternative name or brand name for the airline. Often empty.
"", "Aeroflot"
Most airlines don’t have an alias value. This field is preserved from the OpenFlights schema but is rarely populated.
iata
Two-character IATA airline designator code. May be empty or contain special values like
"-" or "N/A" for airlines without IATA codes."AA", "AF", "DL", "-"
Special cases:
- Empty string: No IATA code assigned
"-": Explicitly marked as having no IATA code"N/A": Not applicable (e.g., private flights)
icao
Three or four-character ICAO airline designator code. May be empty for airlines without ICAO codes.
"AAL", "AFR", "DAL", "N/A"
callsign
Radio callsign used by the airline. May be empty.
"AMERICAN", "AIRFRANS", "DELTA"
Callsigns are used in air traffic control communications and may differ from the airline name.
country
Country where the airline is registered. Uses standardized country names after applying
COUNTRY_CORRECTIONS."United States""South Korea"(not “Republic of Korea”)"Hong Kong""Russia"(not “Russian Federation”)
Country names are normalized to commonly-recognized names rather than official names. See Data Corrections for the full mapping.
active
Whether the airline is currently operational. Values are
"Y" (active) or "N" (inactive)."Y"- Airline is currently operational"N"- Airline is defunct, merged, or no longer operating
The package sorts active airlines first in
airlines.json so that lookups by IATA/ICAO code prioritize active airlines over defunct ones with the same code.CSV Format
Theairlines.dat file uses a simple CSV format without headers:
Column Order
Columns appear in this order:convert.js:6
- ID
- Name
- Alias
- IATA
- ICAO
- Callsign
- Country
- Active
Data Conversion Process
Theconvert.js script transforms CSV to JSON:
The sorting by active status is crucial for lookups. When searching for an airline by IATA code like “AA”, you want the active American Airlines, not a defunct airline that once used that code.
Example Records
Here are some real examples from the data:Data Statistics
The airlines.json file typically contains:- ~6,000+ total airline records
- ~1,000+ active airlines (
active: "Y") - ~5,000+ inactive airlines (
active: "N")
Using the Data in Code
The package wraps the JSON in a Backbone Collection for easy querying:See the Basic Usage guide for more examples of working with the data.
Data Source Attribution
All airline data originates from:- Source: OpenFlights.org
- Repository: jpatokal/openflights
- License: Open Database License (ODbL)
- Updates: Community-maintained, synced weekly
This package applies local corrections for standardization but does not claim ownership of the underlying data. All credit goes to the OpenFlights community.