NewConnect Claude, Cursor, ChatGPT, and other AI agents to API Ninjas via our MCP server

Airports API

The Airports API provides vital information on nearly 30,000 airports worldwide including major international airports and small regional airports.

Available endpoints:

(4.8)

From 4,860 users

2,500+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
361ms395ms450ms803ms1175ms

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:

  • iata  optional

    International Air Transport Association (IATA) airport code (typically 3 characters). Supports partial, case-insensitive matching (e.g. LH matches LHR).

  • icao  optional

    International Civil Aviation Organization (ICAO) 4-character airport code. Supports partial, case-insensitive matching (e.g. EGL matches EGLL).

  • name  optional premium only

    Airport name. Supports partial matching (e.g. Heathrow matches London Heathrow Airport).

  • country  optional premium only

    Airport country. Must be 2-character ISO-2 country code (e.g. GB).

  • region  optional premium only

    Administrative region such as state or province within a country (e.g. California). Supports partial, case-insensitive matching.

  • city  optional premium only

    Airport city (e.g. London). Supports partial, case-insensitive matching (e.g. York may match New York).

  • timezone  optional premium only

    Airport timezone (e.g. Europe/London).

  • min_elevation  optional premium only

    Minimum airport elevation in feet.

  • max_elevation  optional premium only

    Maximum airport elevation in feet.

  • size  optional premium only

    Airport size. Must be one of: large, medium, small.

  • has_iata  optional premium only

    Filter by whether the airport has an IATA code. true returns only IATA-coded airports; false returns only those without.

  • min_runway_length  optional premium only

    Minimum length (in feet) of at least one runway at the airport.

  • limit  optional premium only

    Maximum number of results to return. Must be between 1 and 100. Default is 10.

  • sort  optional premium only

    Sort order for results. Must be one of: passengers (default), name, elevation, runway_length.

  • order  optional premium only

    Sort direction. Must be asc or desc. Default is desc.

  • offset  optional premium only

    Number of results to offset for pagination.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.

  • iata

    3-character IATA airport code.

  • icao

    4-character ICAO airport code.

  • name

    Airport name.

  • city

    City where the airport is located.

  • region

    Administrative region (state or province).

  • country

    2-letter ISO country code.

  • elevation_ft

    Airport elevation in feet.

  • latitude

    Latitude coordinate.

  • longitude

    Longitude coordinate.

  • timezone

    Airport timezone (e.g., Europe/London).

  • size

    Airport size. Possible values: large, medium, small.

  • num_runways

    Number of runways at the airport.

  • runways

    Array of runway objects, each containing:

    • length - Runway length in feet.
    • width - Runway width in feet.
    • has_lights - Whether the runway has lights (true or false).

Sample Request Live Demo!

iata
icao
name 
city 

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/airports?iata=LHR

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

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

  • offset  optional

    Number of results to offset for pagination. Default is 0.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.

  • icao

    4-character ICAO airport code.

  • name

    Airport name.

Sample Request Live Demo!

offset

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/airportslist

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

/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

  • iata  optional

    3-character IATA airport code.

  • icao  optional

    4-character ICAO airport code.

  • code  optional

    Auto-detected IATA (3 chars) or ICAO (4 chars) code.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object containing the following fields, or an error if no airport is found.

  • icao

    4-character ICAO airport code.

  • iata

    3-character IATA airport code.

  • name

    Airport name.

  • city

    City where the airport is located.

  • region

    Administrative region (state or province).

  • country

    2-letter ISO country code.

  • elevation_ft

    Airport elevation in feet.

  • latitude

    Latitude coordinate.

  • longitude

    Longitude coordinate.

  • timezone

    Airport timezone (e.g., Europe/London).

  • size

    Airport size. Possible values: large, medium, small.

Sample Request Live Demo!

code

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/airportconvert?code=LHR

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

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

  • from  required

    Origin airport — IATA (3 chars) or ICAO (4 chars) code.

  • to  required

    Destination airport — IATA (3 chars) or ICAO (4 chars) code.

  • units  optional

    Distance units. Must be one of: km (default), mi, nm.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object containing the following fields, or an error.

  • from

    Origin airport code as provided in the request (uppercased).

  • to

    Destination airport code as provided in the request (uppercased).

  • distance

    Great-circle distance in the requested units.

  • bearing_initial

    Initial bearing from origin to destination, in degrees true (0–360).

  • unit

    Units used for the distance field. One of km, mi, nm.

  • estimated_flight_time_minutes

    Approximate total flight time in minutes, assuming an 800 km/h cruise plus 30 minutes of ground/climb/descent overhead.

Sample Request Live Demo!

from
to
units

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/airportdistance?from=JFK&to=LHR

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

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

  • q  required

    Query string (minimum 2 characters).

  • country  optional

    Restrict results to a country. Must be a 2-character ISO country code (e.g. US).

  • size  optional

    Restrict results to a size. Must be one of: large, medium, small.

  • limit  optional

    Maximum number of results to return. Must be between 1 and 3. Default is 3.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of compact airport records: icao, iata, name, city, country, size.

Sample Request Live Demo!

q
limit

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/airportsuggest?q=lon&limit=3

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

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

  • lat  required

    Latitude of the search center, in decimal degrees (-90 to 90).

  • lon  required

    Longitude of the search center, in decimal degrees (-180 to 180).

  • radius  optional

    Search radius in kilometres. Default is 50, maximum is 500.

  • size  optional

    Restrict to size: large, medium, or small.

  • has_iata  optional

    Filter by whether the airport has an IATA code (true or false).

  • min_runway_length  optional

    Minimum runway length in feet.

  • limit  optional

    Maximum number of results. Must be between 1 and 50. Default is 10.

  • units  optional

    Distance units. Must be km (default) or mi.

Headers

  • X-Api-Key  required

    API 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.

  • icao

    4-character ICAO airport code.

  • iata

    3-character IATA airport code.

  • name

    Airport name.

  • city

    City where the airport is located.

  • region

    Administrative region (state or province).

  • country

    2-letter ISO country code.

  • elevation_ft

    Airport elevation in feet.

  • latitude

    Latitude coordinate.

  • longitude

    Longitude coordinate.

  • timezone

    Airport timezone (e.g., America/Los_Angeles).

  • size

    Airport size. Possible values: large, medium, small.

  • distance

    Great-circle distance from the requested coordinate, in the requested units.

  • bearing

    Initial bearing from the requested coordinate to the airport, in degrees true (0–360).

  • distance_unit

    Units used for the distance field. One of km, mi.

Sample Request Live Demo!

lat
lon
radius

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=80

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON

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"