Airports API
The Airports API provides vital information on nearly 30,000 airports worldwide including major international airports and small regional airports.
Available endpoints:
- /v1/airports - Get detailed information about airports
- /v1/airportslist - Get a list of airport codes and names
- /v1/airportconvert - Convert between IATA and ICAO airport codes
- /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 |
|---|---|---|---|---|
| 361ms | 395ms | 450ms | 803ms | 1175ms |
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).countryoptional premium onlyAirport 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).timezoneoptional premium onlyAirport timezone (e.g.
Europe/London).min_elevationoptional premium onlyMinimum airport elevation in feet.
max_elevationoptional premium onlyMaximum airport elevation in feet.
sizeoptional premium onlyAirport size. Must be one of:
large,medium,small.has_iataoptional premium onlyFilter by whether the airport has an IATA code.
truereturns only IATA-coded airports;falsereturns only those without.min_runway_lengthoptional premium onlyMinimum length (in feet) of at least one runway at the airport.
limitoptional premium onlyMaximum number of results to return. Must be between 1 and 100. Default is 10.
sortoptional premium onlySort order for results. Must be one of:
passengers(default),name,elevation,runway_length.orderoptional premium onlySort direction. Must be
ascordesc. Default isdesc.offsetoptional premium onlyNumber 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.
iata3-character IATA airport code.
icao4-character ICAO 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. Possible values:
large,medium,small.num_runwaysNumber of runways at the airport.
runwaysArray of runway objects, each containing:
length- Runway length in feet.width- Runway width in feet.has_lights- Whether the runway has lights (trueorfalse).
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/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.
icao4-character ICAO airport code.
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/airportconvert GETPremium only
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.
codeoptionalAuto-detected IATA (3 chars) or ICAO (4 chars) code.
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.
icao4-character ICAO airport code.
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. Possible values:
large,medium,small.
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/airportdistance GETPremium 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.
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.
icao4-character ICAO airport code.
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. Possible values:
large,medium,small.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"