# Aviation Weather METAR and TAF Scraper (`automation-lab/aviation-weather-metar-taf-scraper`) Actor

Fetch current or historical official METAR observations and TAF forecasts by ICAO station, with raw reports, timestamps, and decoded aviation weather fields.

- **URL**: https://apify.com/automation-lab/aviation-weather-metar-taf-scraper.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Travel, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.32 / 1,000 item extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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

## Aviation Weather METAR and TAF Scraper

Fetch current or historical official **aviation weather METAR and TAF** reports by ICAO station from AviationWeather.gov.
The Actor exports raw reports, official timestamps, airport coordinates, decoded observation fields, cloud layers, and TAF forecast periods as structured dataset records.

Use it for scheduled airport-weather monitoring, flight-operations dashboards, dispatch research, or one-time weather analysis without maintaining an API client and data pipeline.

### What this Actor does

The Actor sends bounded requests to the official AviationWeather.gov Data API.
It supports:

- current METAR observations;
- METAR history through a configurable lookback window;
- current TAF forecasts;
- an optional historical archive date;
- one to 50 ICAO stations per run;
- raw and normalized fields in the same record;
- a combined METAR and TAF dataset suitable for exports and integrations.

Each METAR observation and each TAF report becomes one dataset item.
TAF change periods remain nested in `forecastPeriods`, so consumers can inspect the complete decoded forecast without reconstructing it from the raw text.

### Who is it for?

#### Flight operations teams

Schedule recurring runs for the airports in an operating network and send new dataset records to a dashboard, database, webhook, or alerting workflow.

#### Dispatchers and flight planners

Retrieve raw reports alongside decoded wind, visibility, cloud, temperature, pressure, and validity fields.
Always use approved operational weather products and procedures for safety-critical decisions.

#### Airport and FBO teams

Collect repeatable station-level snapshots for local operations reviews and weather trend analysis.

#### Data engineers and researchers

Export normalized observations and forecasts to JSON, CSV, Excel, Google Sheets, a data warehouse, or another Apify integration.

### Why use this Actor

- **Official source:** data comes from the public AviationWeather.gov Data API.
- **Raw plus decoded:** preserve the authoritative report text while receiving integration-ready fields.
- **METAR and TAF together:** one input can retrieve both observations and forecasts.
- **Historical controls:** request a METAR lookback or use the source's archive date parameter.
- **Automation ready:** use Apify schedules, API calls, webhooks, Make, Zapier, or MCP.
- **Low overhead:** direct HTTPS requests need no browser and no proxy.
- **Bounded retries:** transient network, rate-limit, and server failures retry up to three total attempts; deterministic client errors fail immediately.

### Data extracted

| Field | Meaning |
| --- | --- |
| `reportType` | `METAR` or `TAF` |
| `stationId` | Four-character ICAO station identifier |
| `stationName` | Airport or station name from the source |
| `rawReport` | Original raw METAR or TAF text |
| `reportTime` | METAR report or TAF bulletin time |
| `observationTime` | METAR observation timestamp |
| `issueTime` | TAF issuance timestamp |
| `validFrom`, `validTo` | Overall TAF validity window |
| `latitude`, `longitude` | Station coordinates |
| `elevationMeters` | Station elevation in meters |
| `temperatureC`, `dewpointC` | Decoded METAR temperatures |
| `windDirectionDegrees` | Wind direction or a source marker such as `VRB` |
| `windSpeedKnots`, `windGustKnots` | Decoded wind values |
| `visibilityStatuteMiles` | Decoded prevailing visibility |
| `altimeterHpa`, `seaLevelPressureHpa` | Pressure values in hectopascals |
| `weather` | Present-weather code when available |
| `flightCategory` | VFR, MVFR, IFR, or LIFR when decoded |
| `cloudLayers` | METAR cloud cover, base, and cloud type |
| `forecastPeriods` | Decoded TAF change periods with wind, visibility, weather, and clouds |
| `sourceUrl` | Exact official API request URL |
| `retrievedAt` | Time this Actor retrieved the record |

Fields that do not apply to a report type are `null` or an empty array.
For example, a TAF record normally has `forecastPeriods` but no METAR temperature.

### Getting started

1. Open the Actor input page.
2. Enter one or more four-character ICAO station IDs.
3. Select METAR, TAF, or both.
4. Keep the default 1.5-hour METAR lookback, or choose a window up to 168 hours.
5. Optionally enter a past ISO 8601 date and time for an archive request.
6. Set the maximum number of report records.
7. Click **Start**.
8. Open the default dataset to inspect, export, or integrate the results.

A useful first input is:

```json
{
  "stationIds": ["KJFK", "KLAX"],
  "reportTypes": ["METAR", "TAF"],
  "metarHours": 1.5,
  "maxItems": 20
}
```

### Input reference

#### `stationIds`

Array of one to 50 ICAO station identifiers.
Values are trimmed, converted to uppercase, deduplicated, and validated as exactly four letters or digits.
Examples include `KJFK`, `KLAX`, `EGLL`, and `RJTT`.
IATA codes such as `JFK` are not accepted.

#### `reportTypes`

Select at least one of:

- `METAR` for observations;
- `TAF` for terminal aerodrome forecasts.

The default retrieves both.

#### `metarHours`

Number from 0 through 168.
It controls how far back the source searches for METAR observations.
It does not alter TAF output.
The default is 1.5 hours.

#### `historicalDate`

Optional ISO 8601 past date and time, such as `2026-09-01T12:00:00Z`.
The Actor passes its normalized UTC value to the official archive parameter for each selected report type.
Archive availability and retention are controlled by AviationWeather.gov.

#### `maxItems`

Maximum combined report records stored in the default dataset, from 1 through 5,000.
The default is 20.
The limit applies across both report types in their selected order.

### Example output

A METAR item has this shape:

```json
{
  "reportType": "METAR",
  "stationId": "KJFK",
  "stationName": "New York/JF Kennedy Intl, NY, US",
  "rawReport": "METAR KJFK 011251Z 24008KT 10SM FEW050 20/12 A3010",
  "reportTime": "2026-09-01T13:00:00.000Z",
  "observationTime": "2026-09-01T12:51:00.000Z",
  "issueTime": null,
  "validFrom": null,
  "validTo": null,
  "temperatureC": 20,
  "dewpointC": 12,
  "windDirectionDegrees": 240,
  "windSpeedKnots": 8,
  "visibilityStatuteMiles": "10+",
  "flightCategory": "VFR",
  "cloudLayers": [{ "cover": "FEW", "baseFeet": 5000, "type": null }],
  "forecastPeriods": [],
  "sourceUrl": "https://aviationweather.gov/api/data/metar?ids=KJFK&format=json&hours=1.5",
  "retrievedAt": "2026-09-01T13:05:00.000Z"
}
```

The exact values change with official source reports.
Nulls are retained so downstream schemas remain stable.

### How much does it cost to fetch airport weather reports?

This Actor uses pay per event:

- one `start` event per run;
- one `item` event for each METAR observation or TAF forecast saved.

The one-time start price is **$0.005**. The BRONZE item price is **$0.003864 per saved report**; the applicable tier is shown before a run starts.
You are never charged an item event for an invalid, duplicate, empty, or rejected source row.
Infrastructure usage is covered by the Actor's event pricing under the applicable Apify plan.

At BRONZE, estimated totals are **$0.008864 for 1 report**, **$0.04364 for 10 reports**, and **$0.3914 for 100 reports**, including one start event.
A current request for five airports and both report types commonly produces around ten records, while a multi-hour METAR lookback can return several observations per station.
Set the maximum-reports input to enforce a hard record and charge ceiling.

### Monitoring airport observations and forecasts

Create an Apify schedule for the station set you monitor.
For example, run every 15 or 30 minutes with:

```json
{
  "stationIds": ["KJFK", "KBOS", "KIAD", "KATL", "KMIA"],
  "reportTypes": ["METAR", "TAF"],
  "metarHours": 1.5,
  "maxItems": 50
}
```

Send the resulting dataset to a webhook or database.
Use `stationId`, `reportType`, and official observation or issue time as a downstream deduplication key.
The Actor intentionally returns the source's current matching records on every run; it does not maintain a cross-run change database.

### Historical weather workflow

For recent observation history, increase `metarHours`.
For a source archive point, supply `historicalDate`.

Historical requests are best used for:

- incident timelines;
- airport conditions around an operational event;
- model or dashboard backfills;
- comparison of forecast issuance with later observations.

The source determines historical retention and which stations have records.
A valid request can therefore return zero records.

### Exports and integrations

From the dataset page, export results as JSON, CSV, Excel, XML, RSS, or JSON Lines.
You can also:

- connect an Apify schedule to a webhook;
- send records to Google Sheets;
- use Make or Zapier for alerts;
- load data through the dataset API;
- trigger downstream Actors;
- ingest report records into a warehouse or time-series database.

For stable downstream keys, combine `reportType`, `stationId`, and the applicable official timestamp.
Do not use `retrievedAt` as the identity of the source report.

### Run through the Apify API

Replace `YOUR_TOKEN` with an Apify API token.

#### cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~aviation-weather-metar-taf-scraper/runs?token=YOUR_TOKEN&waitForFinish=120" \
  -H "Content-Type: application/json" \
  -d '{"stationIds":["KJFK"],"reportTypes":["METAR","TAF"],"maxItems":10}'
```

#### JavaScript

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/aviation-weather-metar-taf-scraper').call({
  stationIds: ['KJFK', 'KLAX'],
  reportTypes: ['METAR', 'TAF'],
  metarHours: 1.5,
  maxItems: 20,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient(token='YOUR_TOKEN')
run = client.actor('automation-lab/aviation-weather-metar-taf-scraper').call(run_input={
    'stationIds': ['EGLL', 'RJTT'],
    'reportTypes': ['TAF'],
    'maxItems': 10,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

### Use with MCP and AI agents

#### Claude Code

Add the Actor to Claude Code through Apify MCP:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/aviation-weather-metar-taf-scraper"
```

#### Claude Desktop

Use this JSON configuration in Claude Desktop:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/aviation-weather-metar-taf-scraper"
    }
  }
}
```

#### Cursor and VS Code

Use the same HTTP MCP server URL in Cursor or VS Code's MCP server settings. Name the server `apify` and keep the Actor-specific `tools` query parameter shown above.

#### Example prompts

- "Fetch the latest METAR and TAF for KJFK and summarize material operational conditions."
- "Get six hours of METAR observations for EGLL and return the timestamps and raw reports."
- "Retrieve the current TAF for KLAX and list every forecast change period."

AI-generated summaries are not authoritative aviation weather products.
Keep the source records and apply qualified review for operational use.

### Limits and reliability

- AviationWeather.gov controls data availability, retention, decoding, and rate limits.
- The Actor accepts station IDs, not airport-name search or three-character IATA codes.
- A station may issue METAR but not TAF, or may have no report in the requested window.
- HTTP 204 from the source is treated as a valid empty result.
- Transient network errors, HTTP 429, and HTTP 5xx retry with bounded backoff.
- Stable HTTP 4xx errors, malformed JSON, and unexpected content types fail the run.
- Requests time out after 30 seconds per attempt.
- The Actor does not use a browser, proxy, credentials, or a hidden data provider.
- `maxItems` stops saved output but is not a source-side pagination control.

### Legality and responsible aviation use

AviationWeather.gov provides public government weather data, but users remain responsible for complying with source terms, applicable law, and Apify policies.
Do not use this Actor to collect restricted or personal information.

Weather output may be delayed, missing, amended, superseded, or decoded differently from an approved operational display.
This Actor is a data automation tool, not a certified flight-planning or weather-briefing service.
For flight decisions, use authorized sources, current official briefings, applicable regulations, and qualified aviation personnel.

### Troubleshooting

#### Why did the run return no records?

Confirm that every value is a four-character ICAO code and that the station issues the selected report type.
Reduce the historical constraints or test a current report.
A source HTTP 204 means no matching official records were available.

#### Why was my input rejected?

Three-character IATA codes such as `JFK` are invalid.
Use `KJFK` instead.
The Actor also rejects more than 50 stations, future archive dates, empty report types, and out-of-range limits.

#### Why are some fields null?

METAR and TAF have different field sets, and individual reports omit optional phenomena.
Use `reportType` to interpret each row and retain `rawReport` when exact source text matters.

#### What should I do after a rate-limit or server error?

The Actor already retries eligible failures three times.
If all attempts fail, wait before retrying the run and check the AviationWeather.gov service status.
Do not start many identical concurrent tasks for the same station set.

### Related Automation Lab Actors

- [FAA NAS Status & Airport Delays Scraper](https://apify.com/automation-lab/faa-nas-status-airport-delays-scraper) — combine official delay advisories with airport weather records.
- [Ryanair Flight Fares and Cheapest Routes Scraper](https://apify.com/automation-lab/ryanair-flight-fares-cheapest-routes) — monitor fare and route data for a separate commercial aviation workflow.

These Actors provide different records and are not weather substitutes.

### FAQ

#### Does it support airports outside the United States?

Yes, when AviationWeather.gov exposes records for the supplied ICAO station.
Examples include `EGLL` and `RJTT`.
Coverage is source-controlled and can vary by report type.

#### Can it fetch METAR and TAF in one run?

Yes.
Keep both values in `reportTypes`; each report is stored as a separate typed dataset item.

#### Can it monitor changes automatically?

Use an Apify schedule to run repeatedly and compare official report timestamps downstream.
The Actor returns source records; it does not send alerts or persist a cross-run change ledger itself.

#### Is raw report text included?

Yes.
Every accepted dataset item contains `rawReport` alongside decoded fields.

#### Does it need an API key or proxy?

No source API key or proxy is required.
An Apify account and token are required when starting it through the Apify API.

#### Is the output safe for flight decisions?

Do not treat this Actor as a certified briefing product.
Use approved operational sources and procedures for safety-critical decisions.

# Actor input Schema

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

One to 50 four-character ICAO station identifiers, such as KJFK, KLAX, EGLL, or RJTT.

## `reportTypes` (type: `array`):

Choose METAR observations, TAF forecasts, or both.

## `metarHours` (type: `number`):

Hours of METAR history to request, from the latest observation (0) through seven days (168). This setting does not change TAF retrieval.

## `historicalDate` (type: `string`):

Optional ISO 8601 UTC date/time used as the source API archive point, for example 2026-09-01T12:00:00Z. Leave empty for current reports.

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

Maximum total METAR and TAF report records saved to the dataset.

## Actor input object example

```json
{
  "stationIds": [
    "KJFK",
    "KLAX"
  ],
  "reportTypes": [
    "METAR",
    "TAF"
  ],
  "metarHours": 1.5,
  "maxItems": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

Default dataset containing all retrieved aviation weather reports.

# 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": [
        "KJFK",
        "KLAX"
    ]
};

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

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

```

## MCP server setup

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

```

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/yahXm67B0SFNsDnYC/builds/EHdMNhU1MeMgpvpTl/openapi.json
