The Airports API provides vital information on nearly 30,000 airports worldwide including major international airports and small regional airports.
https://api.api-ninjas.com/v1/airports
Returns a list of up to 30 airport results. Use the offset
parameter to access more results if available.
At least one of the following parameters (other than offset
) must be set:
icao
optionalInternational Civil Aviation Organization (ICAO) 4-character airport code.
iata
optionalInternational Air Transport Association (IATA) 3-character airport code.
name
optionalAirport name. This parameter supports partial matching (e.g. Heathrow
will match London Heathrow Airport
).
country
optionalAirport country. Must be 2-character ISO-2 country code (e.g. GB
).
region
optionalAdministrative region such as state or province within a country (e.g. California
).
city
optionalAirport city (e.g. London
).
timezone
optionalAirport timezone (e.g. Europe/London
).
min_elevation
optionalMinimum airport elevation in feet.
max_elevation
optionalMaximum airport elevation in feet.
offset
optionalNumber of results to offset for pagination.
X-Api-Key
requiredAPI Key associated with your account.
https://api.api-ninjas.com/v1/airports?name=London Heathrow
Headers
X-Api-Key
Log in or sign up to get your API Key
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[
{
"icao": "EGLL",
"iata": "LHR",
"name": "London Heathrow Airport",
"city": "London",
"region": "England",
"country": "GB",
"elevation_ft": "83",
"latitude": "51.4706001282",
"longitude": "-0.4619410038",
"timezone": "Europe/London"
}
]
1
2
3
4
5
6
7
8
import requests
name = 'London Heathrow'
api_url = 'https://api.api-ninjas.com/v1/airports?name={}'.format(name)
response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
if response.status_code == requests.codes.ok:
print(response.text)
else:
print("Error:", response.status_code, response.text)
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.