# NWS Weather Station Daily High & Low Temperature API (`infocomp/nws-station-daily-highs-lows`) Actor

Official NWS station observations / daily climate data: daily high and low temperature (°F) and precipitation for U.S. weather stations (ICAO ids such as KNYC, KMDW, KAUS). One row per station-day. $2.00 per 1,000 rows. Not endorsed by NOAA or the National Weather Service.

- **URL**: https://apify.com/infocomp/nws-station-daily-highs-lows.md
- **Developed by:** [InfoComp Data](https://apify.com/infocomp) (community)
- **Categories:** Developer tools, Travel
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 station-days

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

## NWS Weather Station Daily High & Low Temperature API

Get the **official daily high and low temperature (°F)** and **precipitation** for U.S. weather stations, one row per station-day. Give the Actor a list of NWS/ICAO station ids such as `KNYC` (New York Central Park), `KMDW` (Chicago Midway) or `KAUS` (Austin) and a recent date range, and it returns the daily maximum, minimum, the time of each (when the report includes it), precipitation, and a `source` of `cli` or `observations`.

Data comes from **official NWS station observations / daily climate data** on the keyless National Weather Service API at [api.weather.gov](https://api.weather.gov). The Actor prefers the official daily climate (CLI) report when one can be parsed, and otherwise computes the daily max and min from that station's observations in **local standard time (LST)**. No API key and no scraping.

**This Actor is not endorsed by NOAA or the National Weather Service.** NWS data is a U.S. government work in the public domain.

### Who is it for?

- Analysts and researchers who need official NWS daily highs, lows and precipitation for a list of U.S. stations.
- Insurance, restoration and operations teams that record a calendar day's observed temperature and rain.
- Anyone who wants a structured, one-row-per-station-day feed instead of parsing CLI text or hourly observations themselves.

### Pricing

**$2.00 per 1,000 station-day rows.** One `Station-day` event ($0.002) per saved row. There is no start fee and no run fee. **Failed runs, empty results and unknown-station lookups are free.** If you set a maximum cost per run, the Actor stops cleanly when it reaches it.

| Station-days | Price |
|---|---|
| 9 (default run: 3 stations × last 3 days) | $0.018 |
| 1,000 | $2.00 |
| 10,000 | $20.00 |

### Input

| Field | Default | What it does |
|---|---|---|
| `stationIds` | `KNYC`, `KMDW`, `KAUS` | NWS/ICAO ids. Three-letter codes such as `NYC` are treated as `KNYC`. Max 50 stations per run. Unknown stations are skipped and not charged. |
| `daysBack` | 3 | Last N calendar days, including today (U.S. Eastern date). Used when `dateFrom` is empty. Today is often still preliminary. Max 7. |
| `dateFrom`, `dateTo` | empty | Exact range, `YYYY-MM-DD`. `dateTo` empty = today. The NWS API retains about **7 days** of station observations, so the range cannot be longer than that. |
| `maxResults` | 50 | Stop after this many station-day rows (stations in input order, dates oldest first). |

An empty input `{}` uses the same defaults as the prefilled input (three stations, last 3 days).

```json
{
  "stationIds": ["KNYC", "KMDW", "KAUS"],
  "daysBack": 3
}
```

**Tip:** schedule it daily with `"daysBack": 2` so you pick up yesterday's final climate report and today's in-progress values.

### What's in each row?

| Field | Meaning |
|---|---|
| `stationId`, `stationName` | ICAO id and NWS station name. |
| `date` | Calendar date in the station's **local standard time**. |
| `timeZone` | IANA time zone of the station, e.g. `America/New_York`. |
| `latitude`, `longitude`, `elevationMeters` | Station coordinates and elevation. |
| `highTempF`, `lowTempF` | Daily maximum and minimum temperature in whole degrees Fahrenheit. |
| `highTempTimeLst`, `lowTempTimeLst` | Time of the high and low in 24-hour LST (`HH:MM`), when the climate report includes it. |
| `precipitationInches`, `precipitationTrace` | Daily precipitation in inches. `precipitationTrace` is true when the official report lists a trace (`T`). |
| `snowfallInches`, `snowfallTrace` | Daily snowfall from the climate report when present. |
| `source` | `cli` when official daily climate values were used; `observations` when the high and low were computed from station observations. |
| `preliminary` | `true` for a same-day climate report that is still "valid as of" a time this afternoon, or for an incomplete observations-only day. |
| `complete` | `true` when the LST day is over and the row is not preliminary. |
| `observationCount` | How many observation records were read for that station-day (informational). |
| `cliProductId`, `cliValidAsOf`, `sourceUrl` | Official product id and link when the source is `cli`. |
| `dataCredit`, `license`, `disclaimer`, `retrievedAt` | Credit, public-domain license, no-endorsement disclaimer, and UTC timestamp. |

#### Sample row

From a real local run on Friday, November 13, 2026 (America/Chicago), for Central Park on November 12. Source is the official NWS daily climate report.

```json
{
  "stationId": "KNYC",
  "stationName": "New York City, Central Park",
  "date": "2026-11-12",
  "timeZone": "America/New_York",
  "latitude": 40.78333,
  "longitude": -73.96667,
  "elevationMeters": 46.9,
  "highTempF": 61,
  "lowTempF": 47,
  "highTempTimeLst": "10:14",
  "lowTempTimeLst": "20:43",
  "precipitationInches": 1.66,
  "precipitationTrace": false,
  "snowfallInches": 0.0,
  "snowfallTrace": false,
  "source": "cli",
  "preliminary": false,
  "complete": true,
  "observationCount": 38,
  "cliProductId": "d6f4d2d0-79b1-4fd6-8923-9acfa8a1e4f2",
  "cliValidAsOf": null,
  "sourceUrl": "https://api.weather.gov/products/d6f4d2d0-79b1-4fd6-8923-9acfa8a1e4f2",
  "dataCredit": "Official NWS station observations / daily climate data (api.weather.gov)",
  "license": "Public domain (U.S. government work)",
  "disclaimer": "Not endorsed by NOAA or the National Weather Service. Data is from official NWS station observations / daily climate data at api.weather.gov and is a U.S. government work in the public domain.",
  "retrievedAt": "2026-11-14T03:32:21Z"
}
```

### How daily values are chosen

1. Look up the station at `api.weather.gov/stations/{id}` (name, time zone, coordinates).
2. Fetch recent daily climate (CLI) products for that station and parse the official high, low, precipitation and snowfall.
3. Also fetch `/stations/{id}/observations` and compute a daily max and min in the station's **local standard time** (the same LST convention used in the CLI "TIME (LST)" column — not daylight time).
4. Prefer CLI values when they parse cleanly. If a climate report is missing or cannot be parsed, use the observation-computed high and low and set `source` to `observations`.
5. When both a preliminary afternoon CLI and a later final report exist for the same date, the final report is used.

The NWS API keeps about **7 days** of station observations. This Actor does not go further back than that.

### Caveats

- **Today is often preliminary.** Afternoon CLI reports are labeled "VALID AS OF ... LOCAL TIME" and are replaced by the next morning's final report.
- **Not every station has a CLI product.** Official climate sites (the default stations, and most major airports) usually do. Other stations fall back to observations.
- **Observation-based highs and lows can differ** from the official climate values by about 1 °F, because they use the observations the API returns (typically hourly plus specials), not the official sensor extrema. Prefer `source: "cli"` when you need the official climate number.
- **Some climate reports leave the time of the high or low as missing (`MM`).** Those time fields are then `null`. This showed up, for example, at Chicago Midway on 2026-11-12.
- **Observation-based daily precipitation** is only filled when at least 20 hourly last-hour values are present. Otherwise `precipitationInches` may be `null` on an observations-only row. CLI precipitation is used whenever the climate report includes it (including a trace).
- **Unknown or silent days are free.** A station that does not exist, or a date with no usable temperature, produces no row and is not charged.
- The NWS observations endpoint's own 24-hour max/min fields are not used (they can be null for stations outside the Central time zone). Daily max and min are either parsed from CLI or computed from the individual observations.

### Source, terms and disclaimer

- Official API: [api.weather.gov](https://api.weather.gov). Documentation: [weather.gov/documentation/services-web-api](https://www.weather.gov/documentation/services-web-api).
- The NWS describes this as open data, free to use for any purpose, with reasonable rate limits. A User-Agent identifying the application is required. This Actor sends `InfoCompNWSDailyHighsLows/0.1 (https://apify.com/infocomp)` (website only, no email), limits itself to two concurrent requests, and retries HTTP 429/5xx and timeouts up to 3 tries with short backoff (2 s, 5 s) inside a 240 s fetch budget, so a run always ends in under 5 minutes.
- **Not endorsed by NOAA or the National Weather Service.** Data is a U.S. government work in the public domain.

See `TERMS_CHECK.md` for the quoted wording and the terms review.

### Maximum charge per run

The Actor checks your maximum total charge before fetching each station and again before saving rows, and never saves more station-days than the cap allows (a cap of $0.016 at $0.002 saves exactly 8 rows). Fetching stops as soon as the cap is reached.

# Actor input Schema

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

U.S. NWS/ICAO station identifiers, e.g. KNYC (New York Central Park), KMDW (Chicago Midway), KAUS (Austin). Three-letter codes such as NYC are accepted and treated as KNYC. Max 50 stations per run. Unknown stations are skipped and not charged.

## `daysBack` (type: `integer`):

Return one row per station for each of the last N calendar days, including today (U.S. Eastern date). Today may still be preliminary. Used when 'Date from' is empty. The NWS API retains about 7 days of observations, so the maximum is 7.

## `dateFrom` (type: `string`):

Optional. First local-standard-time calendar date to include, e.g. 2026-11-11. Leave empty to use 'Days back'. Must fall within the last 7 days.

## `dateTo` (type: `string`):

Optional. Last local-standard-time calendar date to include. Empty = today (U.S. Eastern). Future dates are clamped to today.

## `maxResults` (type: `integer`):

Stop after this many station-day rows (stations are processed in the order you list them, dates oldest first).

## Actor input object example

```json
{
  "stationIds": [
    "KNYC",
    "KMDW",
    "KAUS"
  ],
  "daysBack": 3,
  "maxResults": 50
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "stationIds": [
        "KNYC",
        "KMDW",
        "KAUS"
    ],
    "daysBack": 3,
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("infocomp/nws-station-daily-highs-lows").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": [
        "KNYC",
        "KMDW",
        "KAUS",
    ],
    "daysBack": 3,
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("infocomp/nws-station-daily-highs-lows").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": [
    "KNYC",
    "KMDW",
    "KAUS"
  ],
  "daysBack": 3,
  "maxResults": 50
}' |
apify call infocomp/nws-station-daily-highs-lows --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,infocomp/nws-station-daily-highs-lows"
        }
    }
}
```

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/obhc547LWKq0cGnzH/builds/eVI6IgbieaPu2iqps/openapi.json
