Airport Database API - IATA, ICAO, Flight Distance, METAR avatar

Airport Database API - IATA, ICAO, Flight Distance, METAR

Pricing

from $0.70 / 1,000 results

Go to Apify Store
Airport Database API - IATA, ICAO, Flight Distance, METAR

Airport Database API - IATA, ICAO, Flight Distance, METAR

Airport database and flight distance API in one actor. No API key, no login, no proxy: open data (OurAirports, aviationweather.gov). Look up airports by IATA or ICAO code, name or country, find airports near a point, get distance and flight time, plus live METAR/TAF.

Pricing

from $0.70 / 1,000 results

Rating

0.0

(0)

Developer

Martin Petrov

Martin Petrov

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

10 days ago

Last modified

Features

Limited permissions

Share

Airport Database API - IATA, ICAO, Flight Distance & METAR Weather

One actor for everything about airports: look up any airport by IATA or ICAO code, search by name, country or type, find airports near a latitude/longitude, get the great-circle distance, bearing and estimated flight duration between airports (JFK-LHR), and read the latest METAR and TAF weather for any station.

Built on open data (OurAirports, public domain) and the official NOAA Aviation Weather Center API. No API key, no login, no scraping of websites. Results come back in seconds, as clean JSON, CSV or Excel.

Who needs it

  • Travel apps and flight comparison sites: autocomplete airports, show distance and flight time on a route page, fill city and country from a code.
  • AI travel agents and chatbots: call it from an agent (MCP) to answer "how far is Varna from London?" or "what is the weather at JFK?".
  • Logistics, aviation and charter teams: runway length, surfaces, elevation, nearest airports to a site, bearing between two points.
  • Data teams: a clean, regularly updated airport table with IATA, ICAO, coordinates, time zone and runways, ready for joins.

Six modes

ModeWhat it does
distanceRoutes like JFK-LHR: kilometers, miles, nautical miles, initial bearing, estimated flight time, time zone difference, and CO2 per passenger (official UK DEFRA 2025 factors, by cabin class).
lookupAirport details by IATA or ICAO code.
searchFind airports by text, country (US, BG) and type (large_airport, medium_airport...).
nearbyAirports around a point, sorted by distance (airports with scheduled service by default).
weatherLatest METAR (raw and decoded), optional TAF forecast, and live FAA delay status for US airports.
airlineAirline by IATA (BA, W6) or ICAO (BAW) code or name (Ryanair): name, callsign, country, active flag, and other airlines that used the same code. Or all airlines of a country (BG).

How to use it (step by step)

  1. Click Try for free.
  2. Pick What to do. The default (distance with three sample routes) works immediately.
  3. Fill the matching field: Routes for distance, Airport codes for lookup and weather, Search text / Country / Types for search, Airport codes (airline codes or names) for airline, Latitude / Longitude / Radius for nearby.
  4. Click Start and download JSON, CSV or Excel, or call it by API.

API example (copy and paste)

Replace YOUR_APIFY_TOKEN with your token from Apify Console, Settings, Integrations.

curl -s -X POST "https://api.apify.com/v2/acts/martin10291~airports-flight-distance/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"mode":"distance","routes":["JFK-LHR","SOF-VAR","LAX-NRT"]}'

Weather for three airports:

curl -s -X POST "https://api.apify.com/v2/acts/martin10291~airports-flight-distance/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"mode":"weather","codes":["KJFK","EGLL","LBWN"],"includeTaf":true}'

Airline codes and names (one row per input, same order):

curl -s -X POST "https://api.apify.com/v2/acts/martin10291~airports-flight-distance/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"mode":"airline","codes":["BA","LH","W6","Ryanair"]}'

Use it from AI agents (MCP)

Add this actor as a tool through the Apify MCP server (https://mcp.apify.com), for example in Claude Desktop, Cursor or any MCP client:

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com?tools=martin10291/airports-flight-distance",
"headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
}
}
}

Then ask your agent: "Distance and flight time from Sofia to Varna?" or "Current METAR at Heathrow?".

Input

FieldTypeDescription
modestringdistance, lookup, search, nearby or weather.
routesarrayDistance mode: pairs like JFK-LHR (IATA or ICAO).
codesarrayLookup and weather mode: IATA or ICAO codes.
querystringSearch mode: text in name, city, code or keywords.
countrystringSearch mode: two-letter ISO country code.
typesarraySearch and nearby: airport types to keep.
latitude, longitudenumberNearby mode: center point.
radiusKmintegerNearby mode: radius in km.
scheduledServiceOnlybooleanNearby mode: only airports with scheduled flights (default on).
includeTafbooleanWeather mode: also return the TAF forecast.
includeFaaDelaysbooleanWeather and lookup mode (default on): add faaDelays to US airports - live FAA status (ground stop, ground delay program, arrival/departure delays, closures) with max delay minutes.
onlyNewbooleanMonitoring: only new or changed results.
monitorIdstringSeparate memory per watch list.
maxItemsintegerHard limit on results saved (and paid for).

Output examples

distance

{
"route": "JFK-LHR",
"from": {"iata": "JFK", "icao": "KJFK", "name": "John F. Kennedy International Airport", "city": "New York", "countryCode": "US", "latitude": 40.639447, "longitude": -73.779317},
"to": {"iata": "LHR", "icao": "EGLL", "name": "London Heathrow Airport", "city": "London", "countryCode": "GB", "latitude": 51.470748, "longitude": -0.459909},
"greatCircleKm": 5539.8,
"miles": 3442.3,
"nauticalMiles": 2991.3,
"initialBearingDeg": 51.4,
"initialBearingCompass": "NE",
"estimatedFlightMinutes": 430,
"estimatedFlightTime": "7h 10m",
"estimateAssumptions": "Estimate only: block time = distance / 830 km/h + 30 min taxi/climb/descent overhead. Not a schedule.",
"fromTimezone": "America/New_York",
"toTimezone": "Europe/London",
"timezoneDifferenceHours": 5.0,
"co2": {
"defraCategory": "long-haul",
"kgPerPassenger": 846.6,
"kgPerPassengerWithoutRF": 501.0,
"kgPerPassengerByClass": {"economy": 648.4, "premiumEconomy": 1037.4, "business": 1880.2, "first": 2593.4},
"factorKgPerPassengerKm": 0.15282,
"includesRadiativeForcing": true,
"source": "UK DESNZ/DEFRA GHG conversion factors 2025, Business travel- air (direct flights, 8% distance uplift included)"
}
}

lookup / search / nearby

{
"iata": "JFK", "icao": "KJFK", "name": "John F. Kennedy International Airport", "type": "large_airport",
"city": "New York", "region": "New York", "countryCode": "US", "country": "United States", "continent": "NA",
"latitude": 40.639447, "longitude": -73.779317, "elevationFt": 13,
"timezone": "America/New_York", "utcOffsetHours": -5.0, "scheduledService": true,
"runways": {"count": 4, "longestFt": 14511, "longestM": 4423, "surfaces": ["ASP", "PEM"]},
"wikipedia": "https://en.wikipedia.org/wiki/John_F._Kennedy_International_Airport",
"homeLink": "https://www.jfkairport.com/"
}

Nearby mode adds distanceKm and bearingDeg to every airport.

airline

{
"input": "LH", "type": "airline", "name": "Lufthansa", "alias": null, "iata": "LH", "icao": "DLH",
"callsign": "LUFTHANSA", "country": "Germany", "countryCode": "DE", "active": true, "matchedBy": "iata",
"otherAirlinesWithSameCode": ["Lufthansa Cargo (active)"], "openflightsId": 3320,
"dataSource": "OpenFlights airlines.dat (ODbL 1.0, openflights.org/data)"
}

weather

{
"icao": "EGLL",
"observedAt": "2026-11-01T21:50:00Z",
"rawMetar": "METAR EGLL 012150Z AUTO 35004KT 310V030 9999 SCT027 09/06 Q1035",
"windDirectionDeg": 350, "windSpeedKt": 4, "windGustKt": null,
"visibilitySm": "6+", "temperatureC": 9, "dewpointC": 6,
"altimeterHpa": 1035, "altimeterInHg": 30.56,
"flightCategory": "VFR",
"clouds": [{"cover": "SCT", "base": 2700}],
"rawTaf": "TAF AMD EGLL 011733Z 0118/0224 ..."
}

Live FAA delays (US airports)

In weather and lookup mode every US airport row gets faaDelays from the official FAA NAS status feed (nasstatus.faa.gov, no key):

"faaDelays": {
"status": "ground_delay",
"maxDelayMinutes": 149,
"events": [{"event": "ground_delay", "reason": "runway construction", "avgDelayMinutes": 60, "maxDelayMinutes": 149}],
"faaUpdateTime": "Sun Nov 8 19:02:35 2026 GMT",
"source": "FAA NAS Status (nasstatus.faa.gov)"
}

status is one of normal, ground_stop, closed, ground_delay, delay, airspace_flow, deicing, restricted (partial closure, for example closed to transient GA only). Non-US airports have faaDelays: null in weather mode. With Only new or changed results a new or ended delay counts as a change, so a 15-minute schedule works as a delay alert.

Need delay history (when each ground stop started and ended, delays per airport over past days) or a delay-risk level from weather? Use the sibling US Airport Delays & Weather API - same open data, plus our own FAA archive polled every 5 minutes.

Monitoring and alerts

Turn on Only new or changed results and set a Monitor ID. In weather mode only METARs that changed since the last run are returned (and paid for), so a schedule every 30 minutes behaves like a weather alert feed. In the other modes only airports or routes not seen before for that Monitor ID are returned. Connect Slack, email, Google Sheets, Zapier, Make or a webhook in Apify Console.

Pricing

Pay per result: $1.00 per 1,000 results (one result = one airport, one route or one weather report). The sample input costs a fraction of a cent. Use Max results to cap spending.

Data sources and attribution

  • Airports, runways, countries and regions: OurAirports, public domain. Downloaded at run time and cached for 7 days.
  • Weather: NOAA Aviation Weather Center Data API, official US government data, no key. Requests are kept modest and sent with an honest User-Agent.
  • CO2: UK DESNZ/DEFRA greenhouse gas conversion factors 2025, Business travel- air, Open Government Licence. Factors already include DEFRA's 8% distance uplift.
  • Airlines: OpenFlights airline database, Open Database License (ODbL 1.0), bundled with the actor. Community data whose last bulk update is several years old: use active and check new or renamed carriers yourself.
  • Time zones are derived from airport coordinates with the open-source timezonefinder library.

FAQ

Is the flight duration exact? No. It is an estimate: distance divided by a typical cruise speed of 830 km/h plus 30 minutes for taxi, climb and descent. Real flights vary with winds, routing, aircraft and airline schedules.

How is CO2 calculated? Great-circle km x the official DEFRA 2025 factor (kg CO2e per passenger-km). Haul follows DEFRA: both airports in the UK = domestic, UK to Europe = short-haul, UK to outside Europe = long-haul, any other route = "International, to/from non-UK". kgPerPassenger includes radiative forcing (non-CO2 high-altitude effects), kgPerPassengerWithoutRF does not. Classes DEFRA does not publish for a haul are null. It is a per-passenger estimate for a direct flight, not an airline- or aircraft-specific figure.

Does it track live flights or give timetables and prices? No. It does not provide live flight positions, schedules or fares. For US airports it does show live FAA airport delays (see above). It covers airport data, distances and weather.

Which codes work? 3-letter IATA codes (JFK) and 4-character ICAO codes (EGLL). In airline mode: 2-character airline IATA codes (BA, W6), 3-letter ICAO codes (BAW) or airline names. For weather, any ICAO station code works, even if it is not in the airport table.

How fresh is the airport data? OurAirports is community maintained and updated frequently. The actor refreshes its cached copy every 7 days.

Why is a code not found? Many small airfields have no IATA code. Try the ICAO code, or use search mode. Missing codes are listed in the run summary and are not charged.

What is in the run summary? The RUN_SUMMARY record in the default key-value store lists counts, codes not found and lastError.