Airport Code Lookup
Resolve an IATA or ICAO code, find the airports near a coordinate, and measure the great circle distance between two of them.
Overview
Airports are named twice over. IATA codes are three letters and appear on tickets, boarding
passes and baggage tags. ICAO codes are four letters and appear in flight plans, air traffic
control and aviation weather. The same airport carries both: Frankfurt is FRA to a passenger and
EDDF to a pilot.
One field takes either, along with two other kinds of question, because those are the four ways people arrive: with a code, with a place, with a coordinate, or with a route. Answers come from a copy of the airport data held on this server; nothing you look up is forwarded anywhere.
Web interface
One field, and Enter to look up. The dice fills it with a random example. There is no map on the page, deliberately; see Privacy.
Clicking a row in the list of other airports puts its code in the field and looks that one up, so the same field keeps answering the same way.
What the field accepts
| Typed | Read as |
|---|---|
FRA | an IATA code |
EDDF | an ICAO code |
fra | the same as FRA. Case does not matter |
Frankfurt | a name or a town |
50.0267, 8.5584 | a coordinate, latitude first |
FRA-JFK | a route between two codes |
FRA JFK, FRA to JFK, FRA,JFK | the same route |
A route is tried before a single code, because FRA JFK would otherwise read as a name. When
either half is not a code the whole line is searched as a name instead, which is what makes
Las Vegas work although it matches the same shape.
IATA and ICAO
A code is looked for as IATA first, then ICAO, then the internal identifier of the source data. The answer says which of the three matched.
The order is not decided by length, although three letters are usually IATA and four usually ICAO. Quebec
City is YQB in one system and CYQB in the other, and some internal identifiers are
three characters, so trying them in the order people use them is more reliable than counting.
ICAO codes are regional, which makes them readable once the prefixes are known: E is northern
Europe and ED is Germany, K is the contiguous United States, C is Canada,
Y is Australia. IATA codes carry no such structure.
An airport may have both codes, one, or neither. Of the 86,134 airfields in the data, 9,054 have an IATA code and 10,512 have an ICAO code. Those with neither can still be found by name or coordinate and are shown with their internal identifier, set apart so it is not mistaken for a code.
Two IATA lists exist and only one is here. Airport codes are in this data; metropolitan codes, which
stand for every airport of a city, are a separate list and are not. So LON and NYC are
not found, while LHR and JFK are.
By name or town
Anything that is not a code, a coordinate or a route is searched against airport names and town names. The
match is plain containment, so Heathrow, John F. Kennedy and Frankfurt
all work, while a misspelling does not.
Results are ordered by whether scheduled flights call there, then by the kind of airfield, then by whether it
has an IATA code at all. A search for Frankfurt therefore answers with Frankfurt Main before Hahn,
and Hahn before the helipads.
Nearest to a coordinate
A coordinate pair answers with the nearest airfields and how far each one is, measured as a great circle distance. Closed airfields are left out of this direction.
The search widens until it finds something, so a point in the middle of an ocean still answers, with a distance that says plainly it is nowhere near. There is no upper bound: the distance is the answer to whether the result is useful.
Distance between two
Two codes give the great circle distance, the shortest path over a sphere, in kilometres, nautical miles and statute miles. Nautical miles are included because that is the unit a flight is planned in.
The figure is computed on a sphere of the mean earth radius, 6,371.0088 km. Against the ellipsoid the earth actually is, that is accurate to roughly 0.3 %, which for a flight distance is metres in a kilometre.
The bearing is the initial one, the direction to set off in. On a great circle the direction changes continuously along the route, so the bearing at the far end is a different number. Frankfurt to New York starts out at 294 degrees.
This is the distance through the air between two points on the ground. It is not the distance a particular flight covers, which depends on the route flown, the winds and the airspace.
URL parameters
Whatever the field holds can be put in the path, so a lookup can be linked to directly.
| Path | Answers |
|---|---|
/lookup/airport/FRA | the airport with that IATA code |
/lookup/airport/EDDF | the same airport by its ICAO code |
/lookup/airport/Frankfurt | the airports of that town |
/lookup/airport/FRA-JFK | the distance between the two |
/lookup/airport/50.0267,8.5584 | the airports nearest that point |
A space has to be percent encoded as %20 in a path, which a browser does on its own when the
address is typed. Sharing such a link shows the answer in the preview, so the recipient reads it without
opening the page.
API
The same answers as JSON, at https://api.troubleshooting.tools/v1/lookup/airport/{query}. The
query is whatever the field accepts.
| Field | Meaning |
|---|---|
type | code, search, near or route, which says what the rest of the answer holds |
query.matched | on a code answer, which system matched: iata, icao or ident |
airport | on a code answer, the one airport |
airports | on a search or a coordinate, the list |
from, to, distance | on a route |
elevation_ft, elevation_m | height above sea level, in both units, or null |
distance_km | on a coordinate answer, how far that airport is |
closed | true where the airfield is recorded as closed |
scheduled_service | true where scheduled flights call there |
A limit parameter sets how many airports a search or a coordinate returns, up to 20. There is no
rate limit: the underlying data is a public domain file that anyone can download from its source in a single
request, so there is nothing here worth metering.
Errors
| Status | When |
|---|---|
400 | the query is empty, or longer than 120 characters |
503 | the airport database cannot be reached or cannot answer |
A query that matches nothing is not an error. It answers with an empty list, because "no airport is called that" is a result and not a failure.
The data
From OurAirports, which is public domain and rebuilt nightly. 86,134 airfields, refreshed here once a week.
The source is maintained by volunteers and says of itself that it comes with no guarantee of accuracy. It was therefore checked against Wikidata, which records IATA codes separately and is maintained by different people. Of the codes that matter the two agree closely:
| Kind | Codes | Also in Wikidata |
|---|---|---|
| large airports | 1,171 | 99.7 % |
| medium airports | 3,397 | 99.4 % |
| with scheduled flights | 4,133 | 98.5 % |
| small airports | 4,233 | 87.7 % |
| heliports | 100 | 63.0 % |
Where the two disagree it is over bush strips, helipads and military fields, not over airports anyone looks up. The authoritative sources, IATA's Airline Coding Directory and ICAO Doc 7910, are licensed and may not be redistributed, so a public tool cannot be built on them.
Closed airfields keep neither code in this data, only the internal identifier, which means a code lookup cannot lead to an airport that no longer exists.
Privacy
What you type is answered from the copy of the data on this server and is never forwarded to anyone. No aviation service, no map provider and no third party sees the code, the town or the coordinate you asked about.
There is no map on the page for that reason. A map would make your browser fetch tiles from whoever serves them, and the coordinate you were looking at would travel with the request for them.