Airports API
The Airports API provides vital information on over 85,000 airports, heliports, seaplane bases, and small airfields worldwide — from major international hubs to remote local strips.
Disclaimer: This data is provided for informational purposes only and is not for navigation or any flight-operations or safety-critical use.
Available endpoints:
- /v1/airports - Get detailed information about airports
- /v1/airportconvert - Convert between IATA and ICAO airport codes
- /v1/airportslist - Get a list of airport codes and names
- /v1/airportdistance - Calculate the great-circle distance between two airports
- /v1/airportsuggest - Autocomplete / typeahead suggestions for airport search
- /v1/closestairport - Find the nearest airports to a coordinate
From 4,860 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 370ms | 400ms | 435ms | 579ms | 1140ms |
Didn't find what you were looking for? Suggest an improvement
/v1/airports GET
https://api.api-ninjas.com/v1/airports
Returns a list of up to 10 airport results. Use the offset parameter to access more results if available.
To look up a list of airport codes and names, use the /v1/airportslist endpoint.
Parameters
At least one of the following parameters (other than offset) must be set:
iataoptionalInternational Air Transport Association (IATA) airport code (typically 3 characters). Supports partial, case-insensitive matching (e.g.
LHmatchesLHR).icaooptionalInternational Civil Aviation Organization (ICAO) 4-character airport code. Supports partial, case-insensitive matching (e.g.
EGLmatchesEGLL).nameoptional premium onlyAirport name. Supports partial matching (e.g.
HeathrowmatchesLondon Heathrow Airport).countryoptionalAirport country. Must be 2-character ISO-2 country code (e.g.
GB).regionoptional premium onlyAdministrative region such as state or province within a country (e.g.
California). Supports partial, case-insensitive matching.cityoptional premium onlyAirport city (e.g.
London). Supports partial, case-insensitive matching (e.g.Yorkmay matchNew York).timezoneoptionalAirport timezone (e.g.
Europe/London).min_elevationoptionalMinimum airport elevation in feet.
max_elevationoptionalMaximum airport elevation in feet.
sizeoptionalAirport size. Must be one of:
large,medium,small.has_iataoptionalFilter by whether the airport has an IATA code.
truereturns only IATA-coded airports;falsereturns only those without.min_runway_lengthoptionalMinimum length (in feet) of at least one runway at the airport.
typeoptionalFacility type (more granular than
size). Must be one of:large_airport,medium_airport,small_airport,heliport,seaplane_base,balloonport,closed.scheduled_serviceoptionalFilter by whether the airport has scheduled airline service.
trueorfalse.continentoptionalContinent code. Must be one of:
AF,AN,AS,EU,NA,OC,SA.surfaceoptionalFilter to airports having at least one runway of the given surface category. Must be one of:
paved,unpaved,water,unknown.has_lightsoptionalFilter by whether the airport has at least one lighted runway.
trueorfalse.qoptionalFree-text search across airport name, city, codes, and alternate-name keywords.
include_closedoptionalSet to
trueto include permanently closed airports. Closed airports are excluded by default.limitoptionalMaximum number of results to return. Must be between 1 and 100. Default is 10.
sortoptionalSort order for results. Must be one of:
passengers(default),name,elevation,runway_length,longest_runway,num_runways.orderoptionalSort direction. Must be
ascordesc. Default isdesc.offsetoptionalNumber of results to offset for pagination.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
Response fields
iata3-character IATA airport code.
icao4-character ICAO airport code. May be empty for facilities without an official ICAO code — use
identfor an identifier that is always present.nameAirport name.
cityCity where the airport is located.
regionAdministrative region (state or province).
country2-letter ISO country code.
elevation_ftAirport elevation in feet.
latitudeLatitude coordinate.
longitudeLongitude coordinate.
timezoneAirport timezone (e.g.,
Europe/London).sizeAirport size:
large,medium, orsmall. Only set for airport-type facilities;nullfor heliports, seaplane bases, and balloonports (seetype).num_runwaysNumber of runways at the airport.
identUniversal airport identifier (always present). Equals the ICAO code where one exists, otherwise a local or regional code.
typeFacility type:
large_airport,medium_airport,small_airport,heliport,seaplane_base,balloonport, orclosed.region_codeISO 3166-2 region code (e.g.
US-CA).country_nameFull country name.
continentContinent code (
AF,AN,AS,EU,NA,OC,SA).elevation_mAirport elevation in meters.
scheduled_serviceWhether the airport has scheduled airline service (
trueorfalse).is_closedWhether the facility is permanently closed (
trueorfalse).gps_codeGPS/navigation database code, if available.
local_codeLocal/national airport code, if available.
home_linkOfficial airport website URL, if available.
wikipedia_linkWikipedia article URL, if available.
keywordsArray of alternate names and codes used for search.
longest_runway_ftLength of the longest runway in feet.
runwaysArray of runway objects, each containing:
length- Runway length in feet.width- Runway width in feet.has_lights- Whether the runway has lights (trueorfalse).surface- Raw surface description (e.g.ASP).surface_category- Normalized surface:paved,unpaved,water, orunknown.closed- Whether the runway is closed (trueorfalse).le_ident/he_ident- Runway end designators (e.g.09L/27R).le_heading_deg/he_heading_deg- True heading of each runway end in degrees.
estimated_annual_passengersEstimated yearly passenger volume. This is a heuristic estimate derived from facility type, runways, and country — not an official figure.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/airports?iata=LHRHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/airports?iata=LHR" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
/v1/airportconvert GET
https://api.api-ninjas.com/v1/airportconvert
Convert between IATA and ICAO airport codes. Provide exactly one of iata, icao, or code.
Parameters
iataoptional3-character IATA airport code.
icaooptional4-character ICAO airport code. May be empty for facilities without an official ICAO code — use
identfor an identifier that is always present.codeoptionalAny airport identifier — IATA, ICAO, ident, GPS, or local code. The matching type is detected automatically.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object containing the following fields, or an error if no airport is found.
Response fields
icao4-character ICAO airport code. May be empty for facilities without an official ICAO code — use
identfor an identifier that is always present.iata3-character IATA airport code.
nameAirport name.
cityCity where the airport is located.
regionAdministrative region (state or province).
country2-letter ISO country code.
elevation_ftAirport elevation in feet.
latitudeLatitude coordinate.
longitudeLongitude coordinate.
timezoneAirport timezone (e.g.,
Europe/London).sizeAirport size:
large,medium, orsmall. Only set for airport-type facilities;nullfor heliports, seaplane bases, and balloonports (seetype).
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/airportconvert?code=LHRHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/airportconvert?iata=LHR" \
-H "X-Api-Key: YOUR_API_KEY"/v1/airportslist GETPremium only
https://api.api-ninjas.com/v1/airportslist
Returns a list of up to 100 airport codes and names in alphabetical order. Use the offset parameter to access more results via pagination.
To look up detailed information about an airport, use the icao parameter in the /v1/airports endpoint.
Parameters
offsetoptionalNumber of results to offset for pagination. Default is 0.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
Response fields
icao4-character ICAO airport code. May be empty for facilities without an official ICAO code — use
identfor an identifier that is always present.nameAirport name.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/airportslistHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
/v1/airportdistance GETAnnual subscription only
https://api.api-ninjas.com/v1/airportdistance
Calculate the great-circle distance, initial bearing, and an estimated flight time between two airports.
Parameters
fromrequiredOrigin airport — IATA (3 chars) or ICAO (4 chars) code.
torequiredDestination airport — IATA (3 chars) or ICAO (4 chars) code.
unitsoptionalDistance units. Must be one of:
km(default),mi,nm.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object containing the following fields, or an error.
Response fields
fromOrigin airport code as provided in the request (uppercased).
toDestination airport code as provided in the request (uppercased).
distanceGreat-circle distance in the requested units.
bearing_initialInitial bearing from origin to destination, in degrees true (0–360).
unitUnits used for the
distancefield. One ofkm,mi,nm.estimated_flight_time_minutesApproximate total flight time in minutes, assuming an 800 km/h cruise plus 30 minutes of ground/climb/descent overhead.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/airportdistance?from=JFK&to=LHRHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/airportdistance?from=JFK&to=LHR" \
-H "X-Api-Key: YOUR_API_KEY"/v1/airportsuggest GETPremium only
https://api.api-ninjas.com/v1/airportsuggest
Autocomplete / typeahead suggestions for airport search. Matches against IATA, ICAO, name, and city. Results are ranked by code-prefix match, airport size, and IATA availability.
Parameters
qrequiredQuery string (minimum 2 characters).
countryoptionalRestrict results to a country. Must be a 2-character ISO country code (e.g.
US).sizeoptionalRestrict results to a size. Must be one of:
large,medium,small.limitoptionalMaximum number of results to return. Must be between 1 and 3. Default is 3.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of compact airport records: icao, iata, name, city, country, size.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/airportsuggest?q=lon&limit=3Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/airportsuggest?q=lon&limit=3" \
-H "X-Api-Key: YOUR_API_KEY"/v1/closestairport GETPremium only
https://api.api-ninjas.com/v1/closestairport
Find the airports nearest to a given latitude/longitude. Results are sorted by airport size (largest first), then by distance ascending within each size tier. Each result includes distance and bearing from the input coordinate.
Parameters
latrequiredLatitude of the search center, in decimal degrees (-90 to 90).
lonrequiredLongitude of the search center, in decimal degrees (-180 to 180).
radiusoptionalSearch radius in kilometres. Default is 50, maximum is 500.
sizeoptionalRestrict to size:
large,medium, orsmall.has_iataoptionalFilter by whether the airport has an IATA code (
trueorfalse).min_runway_lengthoptionalMinimum runway length in feet.
limitoptionalMaximum number of results. Must be between 1 and 50. Default is 10.
unitsoptionalDistance units. Must be
km(default) ormi.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects sorted by airport size (largest first), then by distance ascending within each size tier. Each object contains the following fields, or an error.
Response fields
icao4-character ICAO airport code. May be empty for facilities without an official ICAO code — use
identfor an identifier that is always present.iata3-character IATA airport code.
nameAirport name.
cityCity where the airport is located.
regionAdministrative region (state or province).
country2-letter ISO country code.
elevation_ftAirport elevation in feet.
latitudeLatitude coordinate.
longitudeLongitude coordinate.
timezoneAirport timezone (e.g.,
America/Los_Angeles).sizeAirport size:
large,medium, orsmall. Only set for airport-type facilities;nullfor heliports, seaplane bases, and balloonports (seetype).distanceGreat-circle distance from the requested coordinate, in the requested units.
bearingInitial bearing from the requested coordinate to the airport, in degrees true (0–360).
distance_unitUnits used for the
distancefield. One ofkm,mi.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/closestairport?lat=37.78&lon=-122.42&radius=80Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/closestairport?lat=37.78&lon=-122.42&radius=80" \
-H "X-Api-Key: YOUR_API_KEY"Frequently Asked Questions
Can I use the Airports API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Airports API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the Airports API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the Airports API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.How do I look up an airport by its IATA or ICAO code?
Call the/v1/airportsendpoint with theiataparameter (e.g.iata=LHR) or theicaoparameter (e.g.icao=EGLL); both support partial, case-insensitive matching, soLHmatchesLHR. Each result includes fields likename,city,country,elevation_ft,latitude,longitude,timezone, and arunwaysarray; if you only have one code type and need the other, the dedicated/v1/airportconvertendpoint converts between them, or you can pair this with the Timezone API.How can I find the airports nearest to a given location?
Use the/v1/closestairportendpoint with requiredlatandlonparameters plus an optionalradiusin kilometres (default 50, max 500), and it returns matches sorted by size then distance, each including adistanceandbearingfrom your coordinate. To turn a city name into coordinates first, combine it with the City API.Can the API calculate the distance and flight time between two airports?
Yes — the/v1/airportdistanceendpoint takesfromandtoairport codes (IATA or ICAO) and returns the great-circledistance, the initialbearing_initialin degrees true, and anestimated_flight_time_minutesvalue (based on an 800 km/h cruise plus 30 minutes overhead); use theunitsparameter to switch betweenkm,mi, andnm. For airline route context you can also explore the Airlines API.What coverage does the Airports API provide, and how do I build a typeahead search?
It covers over 85,000 airports, heliports, seaplane bases, and small airfields worldwide, from major international hubs to remote local strips. Airports carry asizeoflarge,medium, orsmall, and every facility carries a precisetype(e.g.heliport,seaplane_base). For autocomplete, use the/v1/airportsuggestendpoint with aqquery of at least 2 characters (matched against IATA, ICAO, ident, name, city, and keywords) and an optionallimitof 1 to 20; see the full catalog of related data sources on the APIs page.