Request parameters
Look up a specific airport, find airports by location, or export the directory with these query parameters.
| Parameter | Required | Default | Description |
apikey |
Yes | None | Your assigned API key. Get a free test API key. |
iata |
Conditional | None | Three-letter IATA airport code, such as LHR. |
icao |
Conditional | None | Four-letter ICAO airport code, such as EGLL. |
city_code |
Conditional | None | Three-letter IATA city code, such as LON, to find airports associated with a city. |
country_code |
Conditional | None | Two-letter ISO country code, such as GB, to find airports in a country. |
name |
Conditional | None | Airport name or partial name, such as Heathrow. |
dump |
Conditional | 0 | Set to 1 to export the database. Overrides the other lookup parameters; coverage filters still apply. |
show_disabled |
No | 0 | Set to 1 to include inactive or disabled records. By default, only active records are returned. |
response_type |
No | JSON | Response format: JSON, XML or CSV. CSV triggers a file download. |
major_only |
No | 0 | Set to 1 to include only airports with commercial flights. |
Provide at least one of iata, icao, city_code, country_code, name, or dump=1. Setting dump=1 overrides the other lookup parameters.
View all request parameters →
Common implementation tasks
Download codes for your airport selector
Export active airports with commercial flights as CSV, then build your local search index from codes, names and location identifiers. Use major_only=0 if your product also needs other location types. Check for a populated iata value before adding a code-based lookup.
curl --get 'https://content.airhex.com/api/v3.7.10/airports/' \
--data-urlencode 'apikey=YOUR_API_KEY' \
--data-urlencode 'dump=1' \
--data-urlencode 'major_only=1' \
--data-urlencode 'response_type=CSV' \
--output airports.csv
Find airport codes for a city
Use city_code=LON to retrieve airports associated with London. Keep each airport’s own IATA code and name so travelers can distinguish departure and arrival airports within the same city.
curl --get 'https://content.airhex.com/api/v3.7.10/airports/' \
--data-urlencode 'apikey=YOUR_API_KEY' \
--data-urlencode 'city_code=LON' \
--data-urlencode 'major_only=1'
Find an IATA code from an airport name
Search with name and read iata from the returned records. Partial names can match multiple records, so compare airport names and location fields before selecting a match.
curl --get 'https://content.airhex.com/api/v3.7.10/airports/' \
--data-urlencode 'apikey=YOUR_API_KEY' \
--data-urlencode 'name=Heathrow'
Map an ICAO airport code to an IATA code
Pass the four-letter ICAO code in icao and read the returned iata field to connect aviation records with the airport identifiers used by your booking supplier.
curl --get 'https://content.airhex.com/api/v3.7.10/airports/' \
--data-urlencode 'apikey=YOUR_API_KEY' \
--data-urlencode 'icao=EGLL'
Frequently asked questions
How are airport IATA codes different from city codes?
An airport code identifies a particular airport, such as LHR for London Heathrow. A city code groups a destination, such as LON for London. Use iata for an airport lookup and city_code to find airports associated with a city. Keep the two fields separate when handling a supplier’s “all airports” destination option.
Can I resolve the departure and arrival codes from my booking supplier?
Yes, when the supplied values are IATA airport codes. Look up each code with iata to retrieve its airport name and location. Confirm whether your supplier field represents an airport or a city before choosing the lookup parameter. Use the original supplier code as a fallback if you cannot resolve a match.
Does every returned record represent an airport with commercial flights?
No. The broader dataset can include other location types, such as rail or bus stations and helipads. Set major_only=1 for airports with commercial flights. The full response includes major_airport and sub_type to help your application distinguish records. Check that iata is populated before building a code-based mapping.
Are inactive airports included?
Only active records are returned by default. Set show_disabled=1 if you need inactive records for historical itineraries or reporting, and inspect active before offering an airport in a booking selector.
Can I download and store an airport code directory?
Yes, with an appropriate GEO Essentials license. Use dump=1 and select JSON, XML or CSV with response_type. Choose major_only and show_disabled to match the coverage your product needs. A local directory lets you resolve codes and build airport search without requesting each airport separately.
Should I use the IATA code as my permanent database key?
Retain airhex_id as the permanent record identifier, and use iata as a lookup value. Store updated from the full response when importing records and plan periodic refreshes of your local directory. This also lets you keep records that do not have a populated IATA code.
Can I look up an airport using its ICAO code instead?
Yes. Pass a four-letter airport ICAO code, such as EGLL, in icao and read iata from the response. Airport ICAO codes are distinct from the three-letter ICAO airline codes used by the Airlines API.
Does this API provide flights, fares or live airport departures?
No. This endpoint provides airport reference data. Use your flight supplier for schedules, availability, fares and live flight information. An active airport record or a commercial-flight flag does not establish that a particular route is available to book.