# Airports, Airlines & Flight Routes Scraper (`ninhothedev/airports-airlines-scraper`) Actor

$0.5/1K 🔥 Airports & airlines scraper! 80k airports, 6k carriers & 67k routes with IATA/ICAO codes. No key. JSON, CSV, Excel or API in seconds. Build travel & logistics apps ⚡

- **URL**: https://apify.com/ninhothedev/airports-airlines-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:** Travel, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Airports, Airlines & Flight Routes Scraper

**The complete open aviation reference dataset in one Actor — ~85,000 airports, ~6,000 airlines and ~67,000 flight routes with IATA/ICAO codes, coordinates, elevation and timezones. No API key, no login, no proxy.**

Every travel product eventually needs the same boring-but-critical lookup table: what is the IATA code of that airport, where exactly is it, which timezone is it in, who flies there and from where. Commercial aviation APIs charge per request for this static data. This Actor gives you the whole thing as a clean, structured dataset you can export to JSON, CSV or Excel in a single run.

### What you get

| Mode | Records | Source |
| --- | --- | --- |
| `airports` | ~85,000 airports, heliports, seaplane bases and closed fields | OurAirports, enriched with OpenFlights city + timezone |
| `airlines` | ~6,000 carriers with IATA/ICAO codes and radio callsigns | OpenFlights |
| `routes` | ~67,000 airline route pairs with equipment types | OpenFlights |

### Features

- **Three datasets, one Actor** — switch with a single `mode` input.
- **IATA join enrichment** — airports carry OurAirports geodata *and* the OpenFlights city, UTC offset, IANA timezone name and DST rule, joined on the IATA code.
- **Real filters** — by country (`DE`, `US`, `FR`…), airport type (`large_airport`, `heliport`…) or a list of IATA codes.
- **Streaming** — multi-MB source files are parsed row by row and the run stops the moment `maxItems` is reached, so a 100-row test run finishes in seconds.
- **Clean nulls** — every empty upstream cell becomes `null`. Missing coordinates are never silently turned into `0.0` (Null Island), and the OpenFlights `\N` NULL token never leaks into your data.
- **No credentials** — both sources are public files. Nothing to sign up for, no proxy needed.

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | select | `airports` | `airports`, `airlines` or `routes` |
| `countryFilter` | string | – | ISO 2-letter country code, e.g. `DE`. Ignored in `routes` mode |
| `airportTypeFilter` | string | – | `large_airport`, `medium_airport`, `small_airport`, `heliport`, `seaplane_base`, `closed` |
| `iataFilter` | array | – | Keep only these codes, e.g. `["FRA","JFK"]` |
| `activeOnly` | boolean | `false` | Airlines mode: skip defunct carriers |
| `maxItems` | integer | `1000` | Hard cap, max `50000` |

```json
{
  "mode": "airports",
  "countryFilter": "DE",
  "airportTypeFilter": "large_airport",
  "maxItems": 500
}
```

### Output

Airport record:

```json
{
  "type": "airport",
  "ident": "EDDF",
  "airport_type": "large_airport",
  "name": "Frankfurt Airport",
  "iata_code": "FRA",
  "icao_code": "EDDF",
  "gps_code": "EDDF",
  "local_code": null,
  "latitude": 50.033333,
  "longitude": 8.570556,
  "elevation_ft": 364,
  "continent": "EU",
  "iso_country": "DE",
  "iso_region": "DE-HE",
  "municipality": "Frankfurt am Main",
  "city": "Frankfurt",
  "timezone_offset": 1.0,
  "timezone_name": "Europe/Berlin",
  "dst": "E",
  "has_scheduled_service": true,
  "home_link": "https://www.frankfurt-airport.com",
  "wikipedia_link": "https://en.wikipedia.org/wiki/Frankfurt_Airport",
  "keywords": ["Frankfurt", "Rhein-Main"],
  "source": "ourairports+openflights",
  "scraped_at": "2026-07-28T18:07:07Z"
}
```

Airline record: `airline_id`, `name`, `alias`, `iata`, `icao`, `callsign`, `country`, `is_active`.
Route record: `airline_iata`, `airline_id`, `source_airport`, `source_airport_id`, `dest_airport`, `dest_airport_id`, `is_codeshare`, `stops`, `equipment`.

### Use cases

- **Travel apps** — power airport autocomplete, code-to-name lookups and map pins without paying per query.
- **Route planning** — build a network graph of who flies where, find connections and hub structures from the 67k route pairs.
- **Logistics & freight** — resolve airport codes to coordinates and countries for shipment tracking and ETA models.
- **Aviation datasets** — a clean base table to join with live flight data, on-time statistics or emissions models.
- **Data enrichment** — turn a column of IATA codes in your CRM or booking system into full geodata.

### Pricing

Roughly **$0.5 per 1,000 items**. The whole 85k-airport dataset costs a few dollars to pull once; most users run it once a month and cache the result.

### Data sources & licence

Both upstream datasets are open:

- **[OurAirports](https://ourairports.com/data/)** — released into the **public domain** by its contributors.
- **[OpenFlights](https://openflights.org/data.html)** — the airport, airline and route databases are made available under the **Open Database License (ODbL)**; attribution to OpenFlights is required when you redistribute the data.

This Actor only downloads and reshapes those public files. Keep the attribution when you republish.

### Related Actors

- [ADS-B Flights Scraper](https://apify.com/ninhothedev/adsb-flights-scraper) — live aircraft positions from the ADS-B network
- [Flight Status Scraper](https://apify.com/ninhothedev/flight-status-scraper) — departures, arrivals and delays
- [Public Transit Scraper](https://apify.com/ninhothedev/public-transit-scraper) — GTFS stops, lines and schedules
- [Country Profiles Scraper](https://apify.com/ninhothedev/country-profiles-scraper) — country codes, currencies and demographics

### FAQ

**Do I need an API key?** No. Both sources are public files.

**How fresh is the data?** OurAirports is community-maintained and updated daily; OpenFlights routes are a 2014 snapshot and are best treated as a structural network, not a live timetable.

**Why is `latitude` sometimes `null`?** Because the upstream row has no coordinate. Returning `null` instead of `0.0` keeps bad points off your map.

**Can I get all 85k airports?** Yes — set `maxItems` to 50000 and run twice with different filters, or filter by continent/country.

# Actor input Schema

## `mode` (type: `string`):

Which reference dataset to scrape. 'airports' returns ~85,000 airports, heliports and seaplane bases from OurAirports, enriched with city/timezone from OpenFlights. 'airlines' returns ~6,000 carriers from OpenFlights. 'routes' returns ~67,000 airline route pairs from OpenFlights.

## `countryFilter` (type: `string`):

Optional. Keep only records from this country, e.g. 'DE' for Germany, 'US' for the United States. In 'airports' mode it matches the ISO country code directly; in 'airlines' mode the code is resolved to a country name automatically. Ignored in 'routes' mode, because routes have no country column.

## `airportTypeFilter` (type: `string`):

Optional, 'airports' mode only. Keep only airports of this type. Valid values: large\_airport, medium\_airport, small\_airport, heliport, seaplane\_base, balloonport, closed. Leave empty to return every type.

## `iataFilter` (type: `array`):

Optional. Keep only records matching these 3-letter IATA airport codes (or 2-letter airline codes in 'airlines' mode). In 'routes' mode a route is kept when the code matches the origin, the destination or the operating airline. Leave empty to return everything.

## `activeOnly` (type: `boolean`):

Optional, 'airlines' mode only. When enabled, only carriers flagged as active in OpenFlights are returned; defunct and historical airlines are skipped.

## `maxItems` (type: `integer`):

Maximum number of records to push to the dataset. Rows are streamed and the run stops as soon as this limit is reached, so a small value finishes in seconds. Maximum 50000.

## Actor input object example

```json
{
  "mode": "airports",
  "countryFilter": "DE",
  "airportTypeFilter": "large_airport",
  "iataFilter": [
    "FRA",
    "JFK"
  ],
  "activeOnly": false,
  "maxItems": 1000
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "iataFilter": [
        "FRA",
        "JFK"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/airports-airlines-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "iataFilter": [
        "FRA",
        "JFK",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/airports-airlines-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "iataFilter": [
    "FRA",
    "JFK"
  ]
}' |
apify call ninhothedev/airports-airlines-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ninhothedev/airports-airlines-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/5tO02BhDs4yYvEBeJ/builds/EeGvRnFWaHSVzj1iG/openapi.json
