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 coordinates for your airport map
Export active airports with commercial flights as CSV. Retain latitude, longitude, codes and names to build map markers from a local directory. Use major_only=0 if your product also needs other location types.
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 airport-coordinates.csv
Find coordinates for airports in a city
Use city_code=LON to retrieve airports associated with London. Read latitude and longitude from each record to show the individual airport locations, rather than placing every airport at the city center.
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'
Retrieve coordinates using an ICAO code
Use icao when your data source identifies airports with four-letter codes. EGLL resolves to the same Heathrow record as an IATA lookup for LHR.
curl --get 'https://content.airhex.com/api/v3.7.10/airports/' \
--data-urlencode 'apikey=YOUR_API_KEY' \
--data-urlencode 'icao=EGLL'
Frequently asked questions
What format are the coordinates returned in?
latitude and longitude are separate fields containing decimal-degree values. In the JSON example they are numeric strings. Parse them as numbers when your mapping library requires numeric inputs, and preserve negative signs and the available decimal precision.
Which coordinate should I pass first to my map library?
Check the library’s expected order. Some interfaces take latitude followed by longitude, while others expect longitude followed by latitude. The API returns named fields so you can map each value explicitly instead of relying on an array order.
Does this endpoint find the nearest airport?
No. It looks up airports by the documented identifiers, name or location filters, or exports the directory. To find nearby airports, store the coordinates and perform a distance or spatial query in your application. There is no radius or nearest-airport request parameter on this endpoint.
Can I use the coordinates to estimate travel time to a hotel?
The coordinates can be inputs to your mapping or routing service. A straight-line distance is not a road distance or journey time. Use an appropriate routing provider and the relevant pickup or drop-off location when estimating a ground transfer.
Do the coordinates identify a terminal, gate or pickup point?
These fields describe the airport location. Do not treat them as terminal, gate, runway or passenger pickup coordinates. Use more specific location data when your product needs directions within an airport or a transfer meeting point.
How do I limit my map to airports with commercial flights?
Set major_only=1. Only active records are returned by default; show_disabled=1 includes inactive or disabled records if you need them. The full response includes major_airport, sub_type and active to help your application distinguish records before displaying them.
What should I do if a coordinate is missing or invalid?
Check both fields before creating a marker. Reject missing, blank or non-numeric values, and validate latitude between -90 and 90 and longitude between -180 and 180. Do not turn an empty field into zero; zero itself can be a valid coordinate. Keep unresolved records available for review instead of placing them at a guessed location.
Can I keep an airport coordinate directory in my own database?
Yes, with an appropriate GEO Essentials license. Use dump=1 and choose JSON, XML or CSV with response_type. Retain airhex_id and updated from the full response, and refresh your local records periodically so code, name and coordinate changes can be applied to the same airport identity.