# Global Airport Codes (`bite-sized-insights/global-airport-codes`) Actor

Get worldwide airport data at one API endpoint

- **URL**: https://apify.com/bite-sized-insights/global-airport-codes.md
- **Developed by:** [bite-sized-insights](https://apify.com/bite-sized-insights) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

***Get detailed airport data including name, city, country, coordinates, and elevation from IATA or ICAO airport codes.***

Simply provide a list of airport codes and get back structured location data for each one.

No login required. No cookies needed. Pay-per-event pricing.

### Why Choose This Actor?

**"Resolve airport codes to real-world location data in seconds"**

Our Global Airport Codes actor provides:

- **Worldwide Coverage**: Nearly 86,000 airports, heliports, and airfields across every country
- **IATA and ICAO in One Call**: No need to know which code type you have - both are matched automatically
- **Very Fast Responses**: Parallel processing for large batches
- **Cost-Effective**: Pay only for the airport codes you look up: `$3.00 / 1k codes`
- **Rich Data**: Get name, city, country, coordinates, elevation, and more

### Quick Start

1. Open the actor on Apify and go to the **Input** tab.
2. Paste the example input below (or edit the prefilled list); IATA and ICAO codes can be mixed.
3. Click **Start** and wait for the run to finish.
4. Open the **Output** (dataset) tab to view or export the results as JSON, CSV or Excel.

```json
{
  "codes": ["LAX", "EDDF"]
}
```

Example output item for `LAX`:

```json
{
  "id": "3632",
  "ident": "KLAX",
  "type": "large_airport",
  "name": "Los Angeles International Airport",
  "latitude_deg": "33.942501",
  "longitude_deg": "-118.407997",
  "elevation_ft": "125",
  "continent": "NA",
  "iso_country": "US",
  "iso_region": "US-CA",
  "municipality": "Los Angeles",
  "scheduled_service": "yes",
  "icao_code": "KLAX",
  "iata_code": "LAX",
  "gps_code": "KLAX",
  "local_code": "LAX",
  "home_link": "https://www.flylax.com/",
  "wikipedia_link": "https://en.wikipedia.org/wiki/Los_Angeles_International_Airport",
  "keywords": "Tom Bradley",
  "error": null
}
```

### Usage Examples

#### Resolve a Single Airport Code

```json
{
  "codes": ["LAX"]
}
```

#### Resolve Multiple Airport Codes (IATA and ICAO mixed)

```json
{
  "codes": ["LAX", "KJFK", "LHR", "EDDF"]
}
```

Returns one record per airport code found, with the same fields as the example output item in Quick Start (here four records, for LAX, KJFK, LHR and EDDF).

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `codes` | array | Yes | - | List of IATA (3-letter) and/or ICAO (4-letter) airport codes to resolve (letters only, case-insensitive). 1-1000 per run; duplicates are ignored, invalid or too many codes fail the run |

### Output Fields

| Field | Type | Description |
|-------|------|--------------|
| `id` | string | OurAirports internal ID |
| `ident` | string | Airport identifier (usually the ICAO code) |
| `type` | string | Airport type (large_airport, medium_airport, small_airport, heliport, seaplane_base, closed, etc.) |
| `name` | string | Airport name |
| `latitude_deg` | string | Latitude in decimal degrees |
| `longitude_deg` | string | Longitude in decimal degrees |
| `elevation_ft` | string | Elevation above sea level in feet |
| `continent` | string | Continent code |
| `iso_country` | string | ISO 3166-1 alpha-2 country code |
| `iso_region` | string | ISO 3166-2 region code |
| `municipality` | string | Nearest city/municipality |
| `scheduled_service` | string | Whether the airport has scheduled airline service - "yes"/"no" |
| `icao_code` | string | 4-letter ICAO airport code |
| `iata_code` | string | 3-letter IATA airport code |
| `gps_code` | string | GPS/FAA code |
| `local_code` | string | Local country-specific airport code |
| `home_link` | string | Airport's official website, if known |
| `wikipedia_link` | string | Wikipedia article URL, if known |
| `keywords` | string | Additional search keywords (old names, nearby cities, etc.) |
| `error` | null/string | Error message if lookup failed |

### Free plan

Free-plan users get 5 runs in total. Each free run processes only the first 10 codes in your input (the rest is ignored without an error) and returns at most 10 results.

### Pricing

| Cost | Description |
|------|--------------|
| $0.0001 / start | Charged per actor run |
| $3.00 / 1,000 airport codes | Charged per result returned |

### API Integration

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("bite-sized-insights/global-airport-codes").call(
    run_input={
        "codes": ["LAX", "JFK", "LHR", "CDG"]
    }
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"{item['iata_code'] or item['icao_code']}: {item['name']}, {item['municipality']}")
```

#### JavaScript

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('bite-sized-insights/global-airport-codes').call({
    codes: ['LAX', 'JFK', 'LHR', 'CDG']
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach(item => {
    console.log(`${item.iata_code || item.icao_code}: ${item.name}, ${item.municipality}`);
});
```

### Use Cases

- **Travel & Logistics**: Resolve flight/shipment airport codes to real-world locations
- **Data Enrichment**: Add airport name, city, and coordinates to existing records
- **Mapping**: Get coordinates for plotting airports or flight routes
- **Aviation Analytics**: Filter and cross-reference airports by country, type, or elevation

### Going global?

Looking for postal code data instead? Check out our other actors:

- [US ZIP Code Lookup](https://apify.com/bite-sized-insights/us-zip-codes) - US ZIP codes (5-digit)
- [Norway Postal Code Search](https://apify.com/bite-sized-insights/norwegian-postalcode-to-city-name) - Norwegian postal codes (4-digit)
- [India PIN Code Search](https://apify.com/bite-sized-insights/indian-pincode-postalcode-zip-code-to-city-state) - Indian PIN codes (6-digit)
- [France Postal Code Search](https://apify.com/bite-sized-insights/france-zip-codes) - French postal codes (5-digit)

### Notes

- Codes are matched case-sensitively against both the `iata_code` and `icao_code` columns - no need to specify which type each code is
- Invalid or non-existent airport codes will not appear in results
- Results are returned in no particular order
- Large requests are automatically split into batches and processed in parallel
- Includes closed airports and small/private airfields, not just commercial airports with scheduled service - filter on `type`/`scheduled_service` downstream if you only want commercial airports

***

**Need help?** Open an issue on the actor's repository or contact support through Apify Console.

# Actor input Schema

## `codes` (type: `array`):

List of IATA (3-letter) and/or ICAO (4-letter) airport codes to look up. Both are matched automatically - no need to specify which is which. 1-1000 codes per run, letters only, case-insensitive.

## Actor input object example

```json
{
  "codes": [
    "LAX",
    "JFK",
    "LHR",
    "CDG",
    "HND",
    "LEJ"
  ]
}
```

# Actor output Schema

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

Airport data including IATA/ICAO codes, name, city, country, airport type, and elevation above sea level

# 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 = {
    "codes": [
        "LAX",
        "JFK",
        "LHR",
        "CDG",
        "HND",
        "LEJ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bite-sized-insights/global-airport-codes").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 = { "codes": [
        "LAX",
        "JFK",
        "LHR",
        "CDG",
        "HND",
        "LEJ",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("bite-sized-insights/global-airport-codes").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 '{
  "codes": [
    "LAX",
    "JFK",
    "LHR",
    "CDG",
    "HND",
    "LEJ"
  ]
}' |
apify call bite-sized-insights/global-airport-codes --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bite-sized-insights/global-airport-codes"
        }
    }
}
```

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/noYRYZykimBO0yAFT/builds/6xdJ0l6TgmlK9kvMi/openapi.json
