# METAR & TAF Aviation Weather + NWS Observations (`jpopendata/aviation-weather-metar`) Actor

METAR (raw + decoded) and TAF from the official aviationweather.gov Data API, plus optional NWS station observations, by ICAO code, US state or bounding box, up to 30 days back. Temp in °C/°F, 6h/24h max-min, wind, ceiling, flight category. Unofficial; not affiliated with NOAA/NWS.

- **URL**: https://apify.com/jpopendata/aviation-weather-metar.md
- **Developed by:** [JP Open Data](https://apify.com/jpopendata) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 per 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/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

## METAR & TAF Aviation Weather + NWS Observations

**Airport weather reports for any ICAO station, US state or map box: METAR and SPECI as raw text plus decoded fields, optional TAF forecasts, and optional NWS station observations, up to 30 days back.**

This Actor reads the official **aviationweather.gov Data API** (NOAA / National Weather Service, Aviation Weather Center) and, if you ask for it, **api.weather.gov** station observations for US stations. Every report keeps the original text in `rawText` and adds decoded columns: temperature and dewpoint in °C and °F (tenths of a degree when the report has a T-group), humidity, wind and gusts, visibility, ceiling, flight category (VFR / MVFR / IFR / LIFR), pressure, present weather, precipitation, and the **6-hour and 24-hour maximum / minimum temperature groups** used by weather-market traders.

> **Unofficial tool. Not affiliated with or endorsed by NOAA, the National Weather Service, the FAA, Kalshi or Polymarket.** It uses only the documented public APIs, at most 50 requests per minute (the Data API allows 100), with an identifying User-Agent.

### Quick start — verified input

Run on 2026-10-04 on the Apify platform: one request, under 10 seconds. An empty input `{}` runs exactly this.

```json
{
  "stations": ["KJFK", "KORD", "EGLL", "RJTT"],
  "hoursBack": 2
}
```

Today's history with max/min groups for Central Park and Chicago Midway, plus TAFs:

```json
{
  "stations": ["KNYC", "KMDW"],
  "hoursBack": 24,
  "includeTaf": true
}
```

Current conditions for every airport in Texas:

```json
{
  "stations": [],
  "usStates": ["TX"],
  "hoursBack": 2,
  "latestOnly": true
}
```

#### Common input mistakes

| Wrong | Right | Why |
|---|---|---|
| `"stations": ["LHR"]` | `"stations": ["EGLL"]` | ICAO codes have 4 characters. A 3-letter code gets a K prefix (US only): `ORD` → `KORD`. |
| `"stations": ["New York"]` | `"stations": ["KJFK", "KLGA", "KNYC"]` | Place names are rejected; use ICAO codes or a bounding box. |
| `"boundingBox": "-74.3,40.5,-73.6,41.0"` | `"boundingBox": "40.5,-74.3,41.0,-73.6"` | Latitude first: minLat, minLon, maxLat, maxLon. |
| `"hoursBack": 2000` | `"hoursBack": 720` | The API keeps 30 days; larger values are clamped. |
| NWS for `EGLL` | METAR for `EGLL` | NWS observations exist only for US stations; others are skipped with a note. |

An invalid value stops the run before any request, with a message that names the field and lists valid values.

#### Empty results?

A station that sent no report in the window returns nothing (the API answers "no content"). The run still succeeds, the log names the station, and `RUN_SUMMARY.stationsWithoutData` lists it. Typical causes: a wrong code, a closed or part-time station, or `hoursBack: 1` for a station that reports every few hours.

### What you get

One record per report, with `recordType`:

- **`metar`** — `stationId`, `stationName`, `latitude`, `longitude`, `elevationM`, `reportType` (METAR or SPECI), `observedAt`, `receivedAt`, `rawText`, `temperatureC/F`, `dewpointC/F`, `relativeHumidityPct`, `windDirectionDeg`, `windVariable`, `windSpeedKt`, `windGustKt`, `visibilityMiles`, `visibilityText` ("10+"), `altimeterHpa`, `altimeterInHg`, `seaLevelPressureHpa`, `weather`, `cloudLayers`, `ceilingFt`, `verticalVisibilityFt`, `flightCategory`, `maxTemp6hC/F`, `minTemp6hC/F`, `maxTemp24hC/F`, `minTemp24hC/F`, `precip1hIn`, `precip3hIn`, `precip6hIn`, `precip24hIn`, `snowDepthIn`, `pressureTendencyHpa`.
- **`taf`** (optional) — `reportType` (TAF / TAF AMD), `issuedAt`, `validFrom`, `validTo`, `rawText`, and `forecastPeriods` (from, to, change group FM / TEMPO / BECMG / PROB, wind, visibility, weather, clouds).
- **`nws_observation`** (optional, US) — the NWS quality-controlled values for the same columns (wind converted from km/h, visibility from metres, clouds from metres), plus `textDescription` ("Cloudy").

Every record carries `source`, `sourceUrl`, `license` and `retrievedAt`. All columns exist on every record (null when they do not apply), so CSV exports keep stable columns. The **Temperatures** view shows the max/min groups side by side.

### Reliability

- **No silent truncation.** The Data API returns at most 400 reports per request. Requests are sized below that (stations × hours × 3 ≤ 350), and any answer that still comes back with 400 rows is split (fewer stations, a shorter time slice, or a box cut into quarters) and read again; duplicates are removed.
- **Limits respected.** Requests are sent one at a time, at least 1.2 s apart. A `429` is retried only after the wait the server asks for.
- **Partial success.** If TAF or NWS reading fails, or the request budget runs out, the METAR records already read are kept and the run ends successfully with `complete: false`. If nothing can be read at all, the run fails visibly.

### Honest limits

- History is limited to what the API keeps (30 days for METAR, about 7 days for NWS observations). For older data use an archive.
- Decoding is done by the Aviation Weather Center; this Actor converts units and adds ceiling and humidity, but does not re-decode remarks beyond the max/min, precipitation and pressure-tendency groups the API provides.
- TAF is the current forecast only, not past TAFs.
- Weather markets settle on official climate reports (for example the NWS Daily Climate Report), which can differ slightly from METAR max/min groups. Check each market's rules for its station.
- NWS observations are read for up to 50 US stations per run, one request each.

### Pricing

Pay per record stored in the dataset. A run stops by itself when it reaches the maximum charge you set.

# Actor input Schema

## `stations` (type: `array`):

4-character ICAO codes, one per line, e.g. KJFK, KORD, KNYC (Central Park), KMDW, EGLL, RJTT, LFPG. Case and commas do not matter ("kjfk, egll" works). A 3-letter US airport code (JFK) gets the K prefix with a warning; IATA codes outside the US (LHR) and city names are not accepted. Up to 400 per run.

## `usStates` (type: `array`):

Optional. Two-letter US state codes (TX, CA, NY ...) or names (Texas). Every reporting station in the state is included.

## `boundingBox` (type: `string`):

Optional. "minLat,minLon,maxLat,maxLon" in decimal degrees, e.g. "40.5,-74.3,41.0,-73.6" (New York City airports). Worldwide. At most 20 x 20 degrees.

## `hoursBack` (type: `integer`):

Reports from the last N hours (1..720; the API keeps 30 days). Most airports report every hour (US airports add special SPECI reports), so 24 hours is about 24-40 reports per station.

## `latestOnly` (type: `boolean`):

Keep only the newest report per station within Hours of history (current conditions).

## `includeTaf` (type: `boolean`):

Also return the current TAF (terminal aerodrome forecast) of each station that issues one, with raw text and decoded forecast periods.

## `includeNwsObservations` (type: `boolean`):

Also return NWS station observations from api.weather.gov for US stations (ICAO K..., PA/PH..., TJ...): quality-controlled values in °C/°F, humidity, wind, visibility and the NWS text description. One request per station; at most 50 stations and the last 7 days.

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

Maximum records stored (1..100000). You are charged per record.

## `maxApiRequests` (type: `integer`):

Hard budget of requests for the whole run (1..1000). Requests are sent one at a time at least 1.2 s apart (at most 50 per minute; the Data API allows 100 per minute). Requests are sized to stay under the API's 400-reports-per-request limit, so 50 stations x 24 hours is about 13 requests.

## `proxyConfiguration` (type: `object`):

Optional and normally not needed: both APIs answer Apify datacenter IPs. If set, one sticky session is used for the whole run (never rotation).

## Actor input object example

```json
{
  "stations": [
    "KJFK",
    "KORD",
    "EGLL",
    "RJTT"
  ],
  "usStates": [],
  "boundingBox": "",
  "hoursBack": 2,
  "latestOnly": false,
  "includeTaf": false,
  "includeNwsObservations": false,
  "maxItems": 1000,
  "maxApiRequests": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `records` (type: `string`):

METAR, TAF and NWS observation records with source attribution (source, sourceUrl, license, retrievedAt) on every item.

# 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 = {
    "stations": [
        "KJFK",
        "KORD",
        "EGLL",
        "RJTT"
    ],
    "usStates": [],
    "boundingBox": "",
    "hoursBack": 2,
    "latestOnly": false,
    "includeTaf": false,
    "includeNwsObservations": false,
    "maxItems": 1000,
    "maxApiRequests": 50,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("jpopendata/aviation-weather-metar").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 = {
    "stations": [
        "KJFK",
        "KORD",
        "EGLL",
        "RJTT",
    ],
    "usStates": [],
    "boundingBox": "",
    "hoursBack": 2,
    "latestOnly": False,
    "includeTaf": False,
    "includeNwsObservations": False,
    "maxItems": 1000,
    "maxApiRequests": 50,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("jpopendata/aviation-weather-metar").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 '{
  "stations": [
    "KJFK",
    "KORD",
    "EGLL",
    "RJTT"
  ],
  "usStates": [],
  "boundingBox": "",
  "hoursBack": 2,
  "latestOnly": false,
  "includeTaf": false,
  "includeNwsObservations": false,
  "maxItems": 1000,
  "maxApiRequests": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call jpopendata/aviation-weather-metar --silent --output-dataset

```

## MCP server setup

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

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/0NA9GBbPxEbHMtmpQ/builds/kvomg9M7P09ITcpAf/openapi.json
