# NWS METAR Weather Observations – Typed Fields, No Parsing (`rowfeed/nws-metar-weather-observations`) Actor

One row per METAR weather observation from api.weather.gov: typed temperature, wind, pressure, visibility and humidity fields, not raw METAR text parsing. Free, no API key, all US NWS stations.

- **URL**: https://apify.com/rowfeed/nws-metar-weather-observations.md
- **Developed by:** [Rowfeed](https://apify.com/rowfeed) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 observations

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

Turn **any US airport or weather station** into clean, typed weather data: **one row per METAR observation**, ready for a dashboard, a database, or an AI agent's context window. Give it station IDs (or a US state) and get back temperature, dewpoint, wind, pressure, visibility and humidity as plain numbers — pulled from the official [National Weather Service API](https://api.weather.gov), free and key-free, with no login and no browser.

Built for **data pipelines and dashboards** that need reliable current-conditions feeds without babysitting a parser, **researchers and analysts** who need consistent numeric weather fields across many stations, and **AI agents** that need to hand a station ID to a tool and get back typed numbers instead of raw METAR text to decode themselves.

Most METAR/NWS scrapers on Apify parse the raw METAR text string (`rawMessage`), which the NWS API frequently returns **empty** — that's a likely reason the category's current leader only succeeds on 16% of its runs. This Actor reads the API's own **typed JSON fields** instead (`temperature`, `windSpeed`, `barometricPressure`, ...), which NWS populates even when `rawMessage` is blank.

### What you get

- **One row per observation**, with typed numeric columns — `temperature_c`, `dewpoint_c`, `wind_speed_kmh`, `wind_gust_kmh`, `barometric_pressure_pa`, `sea_level_pressure_pa`, `visibility_m`, `relative_humidity_pct`, `precipitation_last_hour_mm`, `precipitation_last_3h_mm`, `precipitation_last_6h_mm` — already converted from the API's unit-coded objects into plain floats, `null` when NWS itself reports no value. NWS populates the 3-hour precipitation field most often; the 1-hour and 6-hour fields are frequently `null`. After the typed columns, every raw NWS property (`temperature`, `windSpeed`, `cloudLayers`, ... as unit-coded objects) is appended unchanged, so nothing the API returned is lost.
- **Two modes**: `latest` (one row per station, its most recent observation) or `history` (up to N past observations per station, optionally bounded by an ISO `start`/`end` window).
- **Errors instead of crashes** — an unknown station ID becomes a single unbilled error row (`error: "not_found"`, `errorMessage`), and the rest of your station list keeps going.

### Sample row

A real row from a default run against JFK airport:

```json
{
  "station_id": "KJFK",
  "station_name": "New York, Kennedy International Airport",
  "latitude": 40.65,
  "longitude": -73.78,
  "timestamp": "2026-09-11T09:25:00+00:00",
  "text_description": "Mostly Clear",
  "temperature_c": 23.0,
  "dewpoint_c": 13.0,
  "relative_humidity_pct": 53.320072779088,
  "wind_direction_deg": 350.0,
  "wind_speed_kmh": 16.668,
  "wind_gust_kmh": null,
  "barometric_pressure_pa": 101354.61,
  "sea_level_pressure_pa": null,
  "visibility_m": 16093.44,
  "precipitation_last_hour_mm": null,
  "precipitation_last_3h_mm": null,
  "precipitation_last_6h_mm": null,
  "raw_metar": null,
  "url": "https://api.weather.gov/stations/KJFK/observations/2026-09-11T09:25:00+00:00",
  "scraped_at": "2026-09-11T09:49:51+00:00"
}
```

Note `raw_metar` is `null` here — that field only comes back non-empty for stations NWS attaches raw METAR text to, and it's `null` on plenty of real stations (including this one). Every other field above comes straight from NWS's own typed data, independent of whether `rawMessage` is populated. The sample is trimmed to the typed columns; a real row continues with the raw NWS properties (see above).

### Filters

| Input | Default | What it does |
|---|---|---|
| `stationIds` | 8 major US airports (JFK, LAX, ORD, DFW, SEA, ATL, DEN, MIA) | Your own NWS/ICAO station identifiers. Ignored when `state` is set. |
| `state` | unset | Optional 2-letter USPS state/territory code (e.g. `NY`, `HI`). When set, station IDs are resolved from NWS's own `/stations?state=XX` list instead of `stationIds`, capped by `maxStations`. |
| `maxStations` | `50` | Caps how many stations are resolved when `state` is set. |
| `mode` | `latest` | `latest`: one row per station. `history`: up to `maxObservationsPerStation` past observations per station. |
| `maxObservationsPerStation` | `24` | History mode only: stop after this many past observations per station, newest first. |
| `start` / `end` | unset | History mode only: optional ISO 8601 bounds, e.g. `2026-09-01T00:00:00Z`. |

### US stations only

This is a direct read of the US National Weather Service API, so coverage is **US airports and weather stations only** (including territories NWS covers, e.g. Puerto Rico, Guam). It is not a global METAR source.

### No personal data

Every field is a government-published weather measurement tied to a fixed physical station, never a person.

### Pricing

Pay per event, no subscription: **$0.50 per 1,000 observations**. A default run (8 stations, latest mode) costs less than half a cent. Error rows (an unknown station ID) are never charged. If every requested station fails, the run is marked failed rather than quietly returning nothing, and you are billed for nothing.

### Use it from your tools

- **API and SDKs** — call it via the Apify API or the official Python/JavaScript clients: one call to start the run, one to fetch the observation rows as JSON, CSV or Excel.
- **n8n, Make and Zapier** — trigger runs and feed observations into a workflow through Apify's integration for each.
- **AI agents and MCP** — eligible for agentic use via Apify's MCP server with pay-per-event pricing, so an agent can hand it a station ID mid-task and pay only for the observation it actually got back.

### Details

- **Fetching**: plain `httpx` GET over https only (no proxy, no browser), with the descriptive `User-Agent` NWS's API requires. 429 and 5xx responses are retried with exponential backoff (5 tries); 404 is not retried.
- **Units**: NWS reports every field in a fixed metric unit (°C, km/h, Pa, m, percent, mm); this Actor pulls the number out of the API's `{unitCode, value}` object and puts the unit in the column name, so no conversion math is needed downstream.
- **Run stats**: the `STATS` record in the run's key-value store holds per-run counts (stations, observations fetched/charged, requests, error categories).
- **Not affiliated** with NOAA or the National Weather Service — this Actor reads their free public API; it is not an official NOAA/NWS product.

# Actor input Schema

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

NWS/ICAO station identifiers (e.g. major US airports). Ignored when "State" is set. Each becomes one `observation` event ($0.50 per 1,000) in latest mode, or up to "Max observations per station" events in history mode.

## `state` (type: `string`):

Optional 2-letter USPS state/territory code (e.g. NY, HI). When set, station IDs are resolved from api.weather.gov/stations?state=XX instead of using "Station IDs", capped by "Max stations".

## `maxStations` (type: `integer`):

Caps how many stations are resolved when "State" is set. Ignored otherwise.

## `mode` (type: `string`):

"Latest": one row per station (its most recent observation). "History": up to "Max observations per station" past observations per station.

## `maxObservationsPerStation` (type: `integer`):

History mode only: stop after this many past observations per station, newest first.

## `start` (type: `string`):

History mode only: optional ISO 8601 date/time, e.g. 2026-09-01T00:00:00Z. Only observations at or after this time are returned.

## `end` (type: `string`):

History mode only: optional ISO 8601 date/time. Only observations at or before this time are returned.

## Actor input object example

```json
{
  "stationIds": [
    "KJFK"
  ],
  "maxStations": 50,
  "mode": "latest",
  "maxObservationsPerStation": 24
}
```

# Actor output Schema

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

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("rowfeed/nws-metar-weather-observations").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("rowfeed/nws-metar-weather-observations").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 '{}' |
apify call rowfeed/nws-metar-weather-observations --silent --output-dataset

```

## MCP server setup

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

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/VnHtxU6X7gfkgD5fD/builds/3jpQbJ90pnNBgSYCa/openapi.json
