# Airport Reference Lookup (OurAirports) (`phobia82/airport-reference-lookup`) Actor

Look up airports by IATA, ICAO, ident, name, or country in the public-domain OurAirports dataset, downloaded fresh at run time.

- **URL**: https://apify.com/phobia82/airport-reference-lookup.md
- **Developed by:** [Clearfield Data](https://apify.com/phobia82) (community)
- **Categories:** Travel
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 airport records

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Airport Reference Lookup (OurAirports)

Look up airports worldwide by **IATA** (for example DXB), **ICAO** (OMDB), local ident, name, or country, and get coordinates, type, municipality, and scheduled-service flags in one dataset. The Actor is useful for travel apps, aviation tools, and any workflow that needs to resolve airport codes to a canonical record without maintaining your own airport database.

### Data source and freshness

Data is the public-domain [OurAirports](https://ourairports.com/data/) airport database, downloaded at run time from the official CSV mirror at `https://davidmegginson.github.io/ourairports-data/airports.csv`. OurAirports dedicates this dataset to the public domain. The file is fetched fresh on each run, so records follow the current published snapshot (community-maintained, not an official ICAO or IATA product).

### Input

Provide at least one of `identifiers`, `nameContains`, or `country`. If identifiers are set, those codes are resolved (IATA, ICAO, GPS code, local code, or OurAirports ident). `nameContains`, `country`, `types`, and `scheduledServiceOnly` still apply as filters.

| Field | Type | Required | Description | Example |
| --- | --- | --- | --- | --- |
| `identifiers` | array of strings | no (one of this, `nameContains`, or `country`) | IATA (3-letter), ICAO (4-letter), or OurAirports ident codes. Case-insensitive. | `["DXB", "OMDB", "LHR"]` |
| `nameContains` | string | no | Case-insensitive substring matched against airport name or municipality. | `"Dubai"` |
| `country` | string | no | ISO 3166-1 alpha-2 country code. When set, only airports in that country are returned. | `"AE"` |
| `types` | array of strings | no | OurAirports type filter. Allowed: `large_airport`, `medium_airport`, `small_airport`, `heliport`, `seaplane_base`, `balloonport`, `closed`. | `["large_airport"]` |
| `scheduledServiceOnly` | boolean | no | If `true`, only airports marked as having scheduled airline service (default `false`). | `true` |
| `maxItems` | integer | no | Maximum airport records to emit (default `50`, min `1`, max `20,000`). | `10` |

### Output

Each item is one airport row from the OurAirports CSV, with identifiers, location, and type fields.

Example item from a real local test run (Dubai International):

```json
{
  "ident": "OMDB",
  "iata_code": "DXB",
  "icao_code": "OMDB",
  "gps_code": "OMDB",
  "local_code": "",
  "name": "Dubai International Airport",
  "type": "large_airport",
  "municipality": "Dubai",
  "iso_country": "AE",
  "iso_region": "AE-DU",
  "continent": "AS",
  "latitude_deg": 25.24979,
  "longitude_deg": 55.370992,
  "elevation_ft": 62,
  "scheduled_service": "yes",
  "wikipedia_link": "https://en.wikipedia.org/wiki/Dubai_International_Airport",
  "home_link": "https://www.dubaiairport.com/"
}
```

### Pricing

This Actor is **priced per result** at **$0.50 per 1,000 results** (one `result` event for each airport row written to the dataset). For example, 200 airports cost **$0.10** in result charges ($0.0005 per airport).

Apify also bills **platform usage** (compute and storage) for the run according to your Apify plan. Result charges and platform usage appear separately on the run.

### Use cases

- Resolve IATA or ICAO codes to coordinates, names, and ISO country codes.
- Build airport pickers or travel itinerary tools without hosting your own airport table.
- Filter a country's large and medium airports that have scheduled service.
- Enrich flight, logistics, or weather records with municipality and elevation.
- Support aviation research and mapping with a public-domain reference file.
- Let an AI agent turn a city name or airport code into a structured airport record.

### How to use

You can run this Actor from the Apify Console, via the API, from Python or JavaScript, or from an AI agent that speaks MCP.

#### API

```bash
curl "https://api.apify.com/v2/acts/phobia82~airport-reference-lookup/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"identifiers":["DXB","OMDB","LHR"],"maxItems":10}'
```

Replace `YOUR_API_TOKEN` with an API token from [Apify Console → Settings → Integrations](https://console.apify.com/account/integrations). For longer jobs, start a run with [the Run Actor endpoint](https://docs.apify.com/api/v2/act-runs-post) and read the dataset when it finishes.

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("phobia82/airport-reference-lookup").call(run_input={"identifiers": ["DXB", "OMDB", "LHR"], "maxItems": 10})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### JavaScript

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('phobia82/airport-reference-lookup').call({ identifiers: ["DXB", "OMDB", "LHR"], maxItems: 10 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### AI agents and MCP

Connect the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) to an MCP client such as Claude, Cursor, or another compatible agent, then call Actor `phobia82/airport-reference-lookup` with the same JSON input as the API. The agent receives the dataset items as structured results.

### FAQ

**Is this legal to use?** Yes. OurAirports source data is dedicated to the public domain. The Actor downloads the official public CSV; it does not scrape a website behind a login and does not collect personal data.

**Is this an official IATA or ICAO database?** No. It is the community OurAirports dataset, which is widely used as a public-domain reference. Identifiers can differ from paid official publications.

**Do I have to pass both IATA and ICAO?** No. Pass whichever identifiers you have. `DXB` and `OMDB` resolve to the same Dubai International record; duplicates in the input still emit that airport once per matching CSV row (typically once).

**Can I list every airport in a country?** Yes. Set `country` to an ISO 3166-1 alpha-2 code such as `AE` or `GB`, optionally restrict `types`, and raise `maxItems` as needed (up to 20,000).

**How fresh is the data?** The CSV is downloaded at the start of each run from the official OurAirports data mirror, so you get the snapshot published there at that time.

**What if an identifier is unknown?** It simply produces no row. Other identifiers and filters in the same run still apply.

### Limits and known issues

- The full airports CSV is downloaded on every run, so a small lookup still pays the download time.
- `maxItems` is capped at 20,000.
- This is not a live flight-status, delay, or runway-in-use feed.
- Some fields (for example `local_code` or `home_link`) may be empty in the source CSV.
- Type and scheduled-service values follow OurAirports conventions, not a government registry.

### Support

Questions, incorrect data, or a feature request? Open a ticket on this Actor's **Issues** tab in [Apify Console](https://console.apify.com) or on the Actor's Store page. Built by **Clearfield Data**.

# Actor input Schema

## `identifiers` (type: `array`):

IATA (3-letter), ICAO (4-letter), or OurAirports ident codes to look up. Example: DXB, OMDB, KJFK, LHR. Matching is case-insensitive.

## `nameContains` (type: `string`):

Optional case-insensitive substring matched against the airport name or municipality (for example 'Dubai' or 'Heathrow').

## `country` (type: `string`):

Optional ISO 3166-1 alpha-2 country code (for example AE, GB, US). When set, only airports in that country are returned.

## `types` (type: `array`):

Optional OurAirports type filter. Allowed values: large_airport, medium_airport, small_airport, heliport, seaplane_base, balloonport, closed.

## `scheduledServiceOnly` (type: `boolean`):

If true, only return airports that OurAirports marks as having scheduled airline service.

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

Maximum airport records to emit.

## Actor input object example

```json
{
  "identifiers": [
    "DXB",
    "OMDB",
    "LHR",
    "KJFK"
  ],
  "types": [
    "large_airport",
    "medium_airport"
  ],
  "scheduledServiceOnly": false,
  "maxItems": 50
}
```

# Actor output Schema

## `results` (type: `string`):

Default dataset items produced by this Actor.

# 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 = {
    "identifiers": [
        "DXB",
        "OMDB",
        "LHR",
        "KJFK"
    ],
    "types": [
        "large_airport",
        "medium_airport"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("phobia82/airport-reference-lookup").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 = {
    "identifiers": [
        "DXB",
        "OMDB",
        "LHR",
        "KJFK",
    ],
    "types": [
        "large_airport",
        "medium_airport",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("phobia82/airport-reference-lookup").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "identifiers": [
    "DXB",
    "OMDB",
    "LHR",
    "KJFK"
  ],
  "types": [
    "large_airport",
    "medium_airport"
  ]
}' |
apify call phobia82/airport-reference-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,phobia82/airport-reference-lookup"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/VV41PoHaPbl8j6iBu/builds/loscp2XPWPTsILUME/openapi.json
