# US Weather Forecast API - NWS Hourly and 7-Day Forecasts (`neverempty/us-weather-forecast-api`) Actor

7-day and hourly forecasts for any US coordinates, straight from the National Weather Service official API. Fahrenheit and Celsius in every row. No API key, no proxies, nothing that breaks when a weather site is redesigned.

- **URL**: https://apify.com/neverempty/us-weather-forecast-api.md
- **Developed by:** [NeverEmpty](https://apify.com/neverempty) (community)
- **Categories:** Travel, Developer tools, MCP servers
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 forecast row returneds

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?

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

## US Weather Forecast API - NWS Hourly and 7-Day Forecasts

**7-day and hour-by-hour forecasts for any US coordinates, straight from the government's own API.**

This Actor reads `api.weather.gov`, the official public API of the **US National Weather Service (NOAA)**. It is a work of the US government: public domain, no API key, no rate-limit contract to sign, and no terms that forbid redistribution.

Nothing here parses HTML, so nothing here breaks when a weather website is redesigned. No proxies required.

### What you get

One row per forecast period, per location:

| Field | Example | Notes |
|---|---|---|
| `label` | `New York, NY` | Whatever you named the location |
| `city` / `state` | `New York` / `NY` | Resolved by the NWS itself |
| `latitude` / `longitude` | `40.7128` / `-74.006` | The point that was forecast |
| `periodName` | `Today`, `Tonight`, `Tuesday` | NWS names each period |
| `startTime` / `endTime` | `2026-08-24T10:00:00-04:00` | With the location's UTC offset |
| `isDaytime` | `true` | |
| `temperatureF` | `81` | As published |
| **`temperatureC`** | **`27.2`** | **Converted for you** — the NWS only publishes Fahrenheit |
| `precipitationProbabilityPercent` | `21` | `null`, not `0`, when the NWS gives no value |
| `windSpeed` | `6 to 14 mph` | Original wording |
| **`windSpeedMaxMph`** | **`14`** | **Parsed number**, so you can sort and threshold |
| `windDirection` | `SW` | |
| `shortForecast` | `Mostly Sunny then Isolated Showers` | |
| `detailedForecast` | `Isolated showers and thunderstorms after 1pm...` | Full NWS prose |
| `source` | `NWS api.weather.gov (official, public domain)` | |

#### One real row, exactly as the Actor writes it

```json
{
  "label": "New York, NY",
  "city": "New York",
  "state": "NY",
  "latitude": 40.7128,
  "longitude": -74.006,
  "periodNumber": 1,
  "periodName": "Today",
  "startTime": "2026-08-24T10:00:00-04:00",
  "endTime": "2026-08-24T18:00:00-04:00",
  "isDaytime": true,
  "temperatureF": 81,
  "temperatureC": 27.2,
  "precipitationProbabilityPercent": 21,
  "windSpeed": "6 to 14 mph",
  "windSpeedMaxMph": 14,
  "windDirection": "SW",
  "shortForecast": "Mostly Sunny then Isolated Showers And Thunderstorms",
  "detailedForecast": "Isolated showers and thunderstorms after 1pm. Mostly sunny, with a high near 81. Southwest wind 6 to 14 mph. Chance of precipitation is 20%.",
  "source": "NWS api.weather.gov (official, public domain)"
}
```

### Three things this Actor does that the raw API does not

**1. Celsius.** The NWS publishes Fahrenheit only. Every row carries both, so the rest of the world does not have to convert.

**2. A wind number you can sort on.** `"6 to 14 mph"` is a sentence, not a value. Every row also carries `windSpeedMaxMph: 14`.

**3. It says when it cannot answer, instead of returning nothing.** The NWS covers the United States and its territories. Give it a coordinate in Tokyo and you get an explicit *out of range* message in the log — not a silent empty dataset that looks like "no weather today". Missing values stay `null`; they never become a fake `0`.

### Input

Everything is optional. Run it with no input and you get five major US cities.

```json
{
  "locations": [
    { "label": "New York, NY", "latitude": 40.7128, "longitude": -74.006 },
    { "label": "Chicago, IL",  "latitude": 41.8781, "longitude": -87.6298 }
  ],
  "hourly": false
}
```

`"40.7128,-74.006"` as a plain string works too.

| Field | Default | Meaning |
|---|---|---|
| `locations` | 5 US cities | Points to forecast |
| `hourly` | `false` | `false` → ~14 day/night periods over 7 days. `true` → hour-by-hour (156 hours) |
| `maxRetries` | `3` | Retries per location if the NWS returns an error or non-JSON |

### Pricing

**You are charged per forecast row actually returned** — not per run, not per hour. A default run is 70 rows across 5 cities, which took 8 seconds when measured.

### Typical uses

- Weather panels in apps, dashboards and digital signage
- Delivery, logistics and field-work scheduling around rain and wind
- Event and travel planning
- Alerting when a threshold is crossed (`windSpeedMaxMph`, `precipitationProbabilityPercent`)
- Feeding a model or an AI agent that needs official US forecasts

### FAQ

**Does it work outside the United States?**
No, and it will tell you so. The National Weather Service only forecasts the US and its territories. A coordinate outside that range produces a clear *out of range* message rather than an empty result.

**Do I need an API key?**
No. Not for the NWS, and not for a proxy.

**How current is the data?**
It is fetched live from the NWS on every run. Schedule it as often as you like.

**Can I get hourly data?**
Yes — set `hourly` to `true`. Each location then returns 156 hourly rows instead of ~14 periods.

**Is this affiliated with NOAA or the NWS?**
No. It reads their public API. The data is a US government work in the public domain.

### Other tools by NeverEmpty

Every NeverEmpty Actor follows the same rule: it never returns an empty result to mean two different things, and it only charges for rows that actually carry an answer.

- **[earthquakes-usgs](https://apify.com/neverempty/earthquakes-usgs)** - earthquakes from the official USGS feed
- **[sports-scores-api](https://apify.com/neverempty/sports-scores-api)** - scores for 8 leagues in one identical row shape

### Support

Wrong value, missing field, or a location that should work but does not? Open an issue on the **Issues** tab. Reports about incorrect data are fixed first.

# Actor input Schema

## `locations` (type: `array`):

Points to forecast, as objects like {"latitude": 40.7128, "longitude": -74.006, "label": "New York, NY"}. The National Weather Service covers the United States and its territories only. Leave the default to get five major US cities.

## `hourly` (type: `boolean`):

Off returns roughly 14 day/night periods covering the next 7 days. On returns the hour-by-hour forecast (156 hours) for each location.

## `maxRetries` (type: `integer`):

How many times to retry a location if the National Weather Service returns an error or something that is not JSON.

## Actor input object example

```json
{
  "locations": [
    {
      "label": "New York, NY",
      "latitude": 40.7128,
      "longitude": -74.006
    },
    {
      "label": "Los Angeles, CA",
      "latitude": 34.0522,
      "longitude": -118.2437
    },
    {
      "label": "Chicago, IL",
      "latitude": 41.8781,
      "longitude": -87.6298
    },
    {
      "label": "Houston, TX",
      "latitude": 29.7604,
      "longitude": -95.3698
    },
    {
      "label": "Miami, FL",
      "latitude": 25.7617,
      "longitude": -80.1918
    }
  ],
  "hourly": false,
  "maxRetries": 3
}
```

# Actor output Schema

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

All forecast rows produced by this run.

# 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("neverempty/us-weather-forecast-api").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("neverempty/us-weather-forecast-api").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 neverempty/us-weather-forecast-api --silent --output-dataset

```

## MCP server setup

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

```

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/PQDK6SZQb5Vj0vMlv/builds/sS5WRULML0nd69uQx/openapi.json
