# Aviation Weather METAR & TAF (NOAA/FAA) (`phobia82/aviation-weather-metar-taf`) Actor

Fetch official METAR observations and TAF forecasts from the NOAA/FAA Aviation Weather Center by ICAO station code. No API key.

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

## Pricing

$1.00 / 1,000 weather reports

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

## Aviation Weather METAR & TAF (NOAA/FAA)

Fetch official **METAR** observations and **TAF** forecasts from the NOAA/FAA Aviation Weather Center by ICAO station code. Use it when you need current or recent aviation weather for flight planning, operations dashboards, or to enrich airport records — without parsing raw weather bulletins yourself.

### Data source and freshness

Reports come from the official US government Aviation Weather Center API at `https://aviationweather.gov/api/data/`, requested at run time. METARs are the latest observation (or a lookback window if you set `hours`). TAFs are the current official forecast for each station. This is public US government aviation weather data. No login and no API key are required.

### Input

| Field | Type | Required | Description | Example |
| --- | --- | --- | --- | --- |
| `stationIds` | array of strings | yes | Four-letter ICAO airport or station identifiers. | `["OMDB", "EGLL", "KJFK"]` |
| `products` | array of strings | no | Weather products to fetch: `metar`, `taf`, or both (default both). | `["metar", "taf"]` |
| `hours` | integer | no | Optional METAR lookback window in hours (1–48). Leave empty for the latest observation only. Does not apply to TAF. | `6` |
| `maxItems` | integer | no | Maximum METAR/TAF records to emit (default `50`, min `1`, max `2,000`). | `50` |

### Output

Each item is one METAR or TAF report. METAR rows include decoded fields such as flight category, wind, temperature, visibility, and altimeter. TAF rows include `raw_text`, issue/valid times, and a `forecasts` array of forecast periods from the official API. Shared fields such as `flight_category` or `temperature_c` are `null` on TAF rows because they apply to observations.

Example METAR item from a real local test run (London Heathrow):

```json
{
  "product": "metar",
  "station_id": "EGLL",
  "station_name": "London/Heathrow Intl, EN, GB",
  "raw_text": "METAR EGLL 221120Z COR AUTO 09012KT 9999 NCD 08/03 Q1010 NOSIG",
  "report_time": "2026-11-22T11:20:00.000Z",
  "obs_time": 1795346400,
  "flight_category": "VFR",
  "temperature_c": 8,
  "dewpoint_c": 3,
  "wind_dir": 90,
  "wind_speed_kt": 12,
  "wind_gust_kt": null,
  "visibility": "6+",
  "altimeter_hpa": 1010,
  "cover": "CLR",
  "clouds": [],
  "wx_string": null,
  "latitude": 51.477,
  "longitude": -0.461,
  "elevation_m": 26,
  "metar_type": "METAR"
}
```

### Pricing

This Actor is **priced per result** at **$1.00 per 1,000 results** (one `result` event for each METAR or TAF report written to the dataset). For example, 50 reports cost **$0.05** in result charges ($0.001 per report).

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

- Pull current METARs for a watch-list of airports into a briefing or operations dashboard.
- Retrieve official TAF forecasts alongside observations for the same ICAO stations.
- Enrich flight, dispatch, or travel workflows with flight category, wind, and visibility.
- Look back up to 48 hours of METAR history with the `hours` parameter.
- Support aviation research and training tools with raw and decoded text.
- Let an AI agent answer “what is the weather at OMDB?” from official AWC data.

### 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~aviation-weather-metar-taf/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"stationIds":["OMDB","EGLL","KJFK"],"products":["metar","taf"],"maxItems":20}'
```

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/aviation-weather-metar-taf").call(run_input={"stationIds": ["OMDB", "EGLL", "KJFK"], "products": ["metar", "taf"], "maxItems": 20})
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/aviation-weather-metar-taf').call({ stationIds: ["OMDB", "EGLL", "KJFK"], products: ["metar", "taf"], maxItems: 20 });
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/aviation-weather-metar-taf` with the same JSON input as the API. The agent receives the dataset items as structured results.

### FAQ

**Is this legal to use?** Yes. The Actor calls the official public Aviation Weather Center API (US government aviation weather). It does not log in, does not scrape a website unofficially, and does not collect personal data.

**Can I use IATA codes such as DXB or LHR?** No. The AWC API expects four-letter **ICAO** identifiers (`OMDB`, `EGLL`, `KJFK`). Resolve IATA codes first (for example with the Airport Reference Lookup Actor).

**What does `hours` do?** It is passed through as the official METAR `hours` parameter so you can request history (1–48 hours). It is not added to TAF requests.

**Why is visibility `"6+"`?** That is the value returned by the Aviation Weather Center API for visibility at or beyond the encoded cap, not a value invented by this Actor.

**Do you issue flight advice?** No. Reports are passed through from the official API for information only. They are not operational briefing or dispatch approval.

**What if a station has no report?** That station simply contributes no row for that product. Other stations in the same run are still fetched. HTTP errors are logged and that product is skipped.

### Limits and known issues

- `maxItems` is capped at 2,000 and counts METARs and TAFs together, in product order (all requested METARs, then TAFs, until the cap).
- Coverage and latency follow the Aviation Weather Center feed; some non-US stations may be missing or delayed.
- TAF `forecasts` periods use the API's native structure (including Unix `timeFrom` / `timeTo` values).
- This is not a SIGMET, AIRMET, PIREP, or radar product.
- IATA codes are not accepted.

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

## `stationIds` (type: `array`):

Four-letter ICAO airport or station identifiers. Example: OMDB, EGLL, KJFK, OERK.

## `products` (type: `array`):

Weather products to fetch. Allowed values: metar, taf. Defaults to both.

## `hours` (type: `integer`):

Optional number of hours of METAR history to request (Aviation Weather `hours` parameter). Leave empty for the latest observation only.

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

Maximum METAR/TAF records to emit.

## Actor input object example

```json
{
  "stationIds": [
    "OMDB",
    "EGLL",
    "KJFK"
  ],
  "products": [
    "metar",
    "taf"
  ],
  "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 = {
    "stationIds": [
        "OMDB",
        "EGLL",
        "KJFK"
    ],
    "products": [
        "metar",
        "taf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("phobia82/aviation-weather-metar-taf").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 = {
    "stationIds": [
        "OMDB",
        "EGLL",
        "KJFK",
    ],
    "products": [
        "metar",
        "taf",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("phobia82/aviation-weather-metar-taf").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 '{
  "stationIds": [
    "OMDB",
    "EGLL",
    "KJFK"
  ],
  "products": [
    "metar",
    "taf"
  ]
}' |
apify call phobia82/aviation-weather-metar-taf --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,phobia82/aviation-weather-metar-taf"
        }
    }
}
```

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/5l00d8V79SaFNoffw/builds/HH0HaYgu5LykEXmdH/openapi.json
