# US Weather API (National Weather Service) (`darikami/us-weather-nws`) Actor

US weather from the National Weather Service API: the forecast and the hourly forecast of a point, the latest or recent observations of a station, and active alerts by point or state. Values as the NWS publishes them.

- **URL**: https://apify.com/darikami/us-weather-nws.md
- **Developed by:** [DARIKAMI GmbH](https://apify.com/darikami) (community)
- **Categories:** Other, Developer tools
- **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 weather row delivereds

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

## US Weather API (National Weather Service)

**US weather from the National Weather Service API: the forecast and the hourly forecast of a point, the latest or recent observations of a station, and the active alerts of a point or a state.**
The main fields are the period, the temperature, the chance of rain, the wind, the short forecast, the station's reading and the alert's event and severity. The data comes from the NWS's own API.
**USD 0.002 per row (USD 2 per 1,000).** One row is one forecast period, one hourly period, one observation or one alert. Errors and the note "no active alert" are free.

| Period | Starts | Temperature | Rain chance | Wind | Forecast |
|---|---|---|---|---|---|
| Today | 2026-11-08 07:00 | 60 F | 1 % | 7 to 10 mph | Sunny |
| Tonight | 2026-11-08 18:00 | 48 F | 2 % | 9 mph | Mostly Clear |
| Monday | 2026-11-09 06:00 | 58 F | 4 % | 7 to 13 mph | Mostly Sunny |
| Monday Night | 2026-11-09 18:00 | 46 F | 0 % | 6 to 10 mph | Mostly Clear |
| Tuesday | 2026-11-10 06:00 | 60 F | 0 % | 8 mph | Mostly Sunny |

The rows come from a real cloud run of 2026-11-08: the forecast of the point 40.7829,-73.9654 (New York), at most 5 rows. The full item is under Output.

### Who uses it

- **Apps and dashboards:** put the forecast or the latest reading of a US place into your own product.
- **Operations and logistics:** watch the active alerts of a state or of your sites.
- **Data work:** collect a station's observations of the last hours (up to 168) next to your own records.

### What it does not do

- It covers the United States and its territories. A point outside returns a free `not-found` item.
- It does not predict anything itself. It returns what the NWS publishes. The actor adds `temperatureF` (converted from degrees C), rounds observation values to 0.1, and cuts alert texts at 4,000 characters. A forecast is the NWS's forecast, not ours.
- An observation is a station's reading. It can differ from the weather at your point, and a station can report a value late or not at all (the field is then `null`).
- The actor does not settle, grade or predict any market, bet or contract. Use the station and rules of your own contract.
- It sends one request at a time. A point needs 2 to 3 requests, so a run of 100 points takes a few minutes.

### Input

```json
{
  "points": ["40.7829,-73.9654"],
  "stations": ["KNYC"],
  "states": ["TX"],
  "products": ["forecast", "hourly", "observation", "alerts"],
  "hours": 24,
  "observationHours": 0,
  "maxResults": 1000
}
```

| Field | What it does |
|---|---|
| `points` | US locations as "latitude,longitude". Rounded to 4 decimals. Forecast and hourly need one. |
| `stations` | Station codes, for example `KNYC`, for the product `observation`. |
| `states` | Two-letter codes, for the product `alerts`. |
| `products` | `forecast`, `hourly`, `observation`, `alerts`. Default: `forecast`. |
| `hours` | Hourly periods per point, 1 to 156. Default 24. |
| `observationHours` | 0: the latest observation. 1 to 168: the observations of the last hours (the actor follows the API's next pages, at most 10 pages of 500). |
| `maxResults` | The run stops after this number of rows. Default 1,000. |

An observation for a point uses the nearest station of the point's grid.

### Output

One item per row. A forecast row:

```json
{
  "kind": "forecast",
  "query": "40.7829,-73.9654",
  "place": "New York, NY",
  "timeZone": "America/New_York",
  "gridpoint": "OKX/34,45",
  "name": "Today",
  "startTime": "2026-11-08T07:00:00-05:00",
  "endTime": "2026-11-08T18:00:00-05:00",
  "isDaytime": true,
  "temperature": 60,
  "temperatureUnit": "F",
  "precipitationChancePercent": 1,
  "windSpeed": "7 to 10 mph",
  "windDirection": "W",
  "shortForecast": "Sunny",
  "detailedForecast": "...",
  "forecastUpdated": "2026-11-08T...",
  "source": "National Weather Service API (api.weather.gov)"
}
```

- An observation row (`kind: "observation"`) holds `station`, `timestamp`, `temperatureC`, `temperatureF`, `dewpointC`, `humidityPercent`, `windSpeedKmh`, `windGustKmh`, `pressurePa`, `visibilityM`, `textDescription` and `rawMetar`.
- An alert row (`kind: "alert"`) holds `event`, `severity`, `urgency`, `certainty`, `headline`, `areaDesc`, `sent`, `onset`, `expires`, `senderName`, `description` and `instruction`.
- Free items have `type`: `not-found`, `error` or `info`.

### Pricing (pay per event)

| Event | Price | When |
|---|---|---|
| `row` | **USD 0.002** | one forecast period, hourly period, observation or alert pushed to the dataset |

Free: error items, `not-found` items, the note "no active alert" and the note that maxResults stopped the run.
1,000 rows cost USD 2.
You pay no more than the maximum charge that you set for a run.

### Data source and terms

- **Source:** the National Weather Service API, `https://api.weather.gov` (documentation: `https://www.weather.gov/documentation/services-web-api`). No key.
- **Terms** (read 2026-11-08): the NWS describes the API as "intended to be open data, free to use for any purpose". Its disclaimer page says NWS information is in the public domain. You may use it for any lawful purpose if you do not claim it as your own, imply an endorsement, or modify it and present it as official.
- The NWS asks every client to send a User-Agent with a contact. The actor does. The NWS does not publish its rate limit and says a blocked request can be retried after about 5 seconds. The actor sends one request at a time, 300 ms apart, and waits and retries when the NWS asks.
- This actor is not affiliated with or endorsed by NOAA or the NWS. It is provided without warranty.

### Reliability

A run fails with exit code 1 and an `ERROR` line in the log in these cases:

- more than half of the steps fail, or 4 steps in a row fail, after the retries;
- many answers are not JSON or lack the forecast data (each counts as a failed step; one such answer alone is a free `error` item).

The rows found until then stay in the dataset.
The run summary is in the default key-value store under `SUMMARY`, the counts under `STATS`.

**More official-data actors by darikami:** [European company registers](https://apify.com/darikami/european-company-registers) · [SEC company fundamentals](https://apify.com/darikami/sec-company-fundamentals) · [Swiss UID validator](https://apify.com/darikami/swiss-uid-validator) · [French company search](https://apify.com/darikami/french-company-search).
In an AI agent: ask the Apify MCP server (`mcp.apify.com`) for `darikami/us-weather-nws`.

# Actor input Schema

## `points` (type: `array`):

US locations as "latitude,longitude", for example 40.7829,-73.9654. Rounded to 4 decimals. Needed for forecast and hourly.

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

Observation station codes, for example KNYC. Used for the product observation.

## `states` (type: `array`):

Two-letter codes, for example TX. Used for the product alerts.

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

Empty: forecast. Forecast and hourly need a point. Observation needs a point or a station. Alerts need a point or a state.

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

How many hourly periods to return per point, 1 to 156.

## `observationHours` (type: `integer`):

0 returns the latest observation. Above 0 returns the observations of the last hours (0 to 168).

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

The run stops after this number of rows.

## Actor input object example

```json
{
  "points": [
    "40.7829,-73.9654"
  ],
  "products": [
    "forecast"
  ],
  "hours": 24,
  "observationHours": 0,
  "maxResults": 10
}
```

# Actor output Schema

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

One item per forecast period, hourly period, observation or alert.

## `summary` (type: `string`):

SUMMARY record: pushed, charged, attempts, errors, stoppedByBudget, ok, message.

## `stats` (type: `string`):

STATS record: requests, rows read, emitted, charged, places not found, failed steps, locations without an alert.

# 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 = {
    "points": [
        "40.7829,-73.9654"
    ],
    "products": [
        "forecast"
    ],
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("darikami/us-weather-nws").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 = {
    "points": ["40.7829,-73.9654"],
    "products": ["forecast"],
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("darikami/us-weather-nws").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 '{
  "points": [
    "40.7829,-73.9654"
  ],
  "products": [
    "forecast"
  ],
  "maxResults": 10
}' |
apify call darikami/us-weather-nws --silent --output-dataset

```

## MCP server setup

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

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/8qk4U7hMXSE5zFar0/builds/2dZ8ZyV9RPgRlRPkB/openapi.json
