# NOAA Weather Forecast & Alerts (`devilscrapes/noaa-weather-forecast-alerts-scraper`) Actor

Join National Weather Service (NOAA/NWS) 7-day forecasts, optional hourly forecasts, and active weather alerts for up to 25 US coordinates in one keyless-API run. Get grid-resolved forecast periods, alert severity and urgency, and location metadata as one clean row per coordinate — no API key.

- **URL**: https://apify.com/devilscrapes/noaa-weather-forecast-alerts-scraper.md
- **Developed by:** [DevilScrapes](https://apify.com/devilscrapes) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## NOAA Weather Forecast & Alerts

**💰 $5.20 / 1 000 results**  ·  pay only for results  ·  no credit card to try

*We do the dirty work so your dataset stays clean.* 😈

Join NOAA/NWS 7-day forecasts, optional hourly forecasts, and active weather alerts for up to 25 US coordinates in a single keyless-API run. Get grid-resolved forecast periods, alert severity and urgency, and location metadata as one clean row per coordinate — no API key, no manual grid math.

</div>

***

### 🎯 What this scrapes

Given a batch of up to 25 US latitude/longitude coordinates, this Actor calls NOAA/NWS's free `api.weather.gov` API to resolve each point's forecast grid, pull its 7-day forecast (plus an optional bounded hourly forecast), and check for currently active weather alerts — then joins all three into one dataset row per location. `api.weather.gov` needs no API key, but getting a usable answer means three to four separate calls per point, correct handling of out-of-coverage coordinates, and capping the ~156-period hourly payload yourself. This Actor does that plumbing so you get a ready-to-use row instead of a stack of raw NWS JSON to reconcile.

### 🔥 What we handle for you

- 🔗 **We do the three-call join for you** — grid resolution, forecast, and active alerts stitched into one row per coordinate, no NWS grid math required on your end.
- 🔁 **We retry on `408 / 429 / 503` and network errors** — exponential backoff up to 5 attempts, honouring `Retry-After`.
- 🌐 **Apify Proxy rotation** on every request — standard hygiene, fresh session per call.
- 🧭 **Out-of-coverage coordinates are handled gracefully** — a location outside NWS coverage is skipped with a clear status message, never a failed run.
- 🧊 **Clean, typed dataset rows** — Pydantic-validated, ISO-8601 timestamps, ready for JSON, CSV, or Excel export.
- 💰 **Pay-Per-Event pricing** — you only pay for locations that actually resolved. No data, no charge.

### 💡 Use cases

- Logistics and routing — pull multi-stop forecasts and active alerts before dispatching a route.
- Agriculture — check 7-day and hourly forecasts across multiple fields in one run.
- Insurance risk — screen a portfolio of property coordinates for active severe-weather alerts.
- Events and venue planning — confirm forecast and alert status for outdoor event locations.
- Energy-demand forecasting — feed grid-level temperature and forecast data into a demand model.

### ⚙️ How to use it

1. Click **Try for free** at the top of the page.
2. Fill in the input form — most fields have sensible defaults.
3. Click **Start**. Output streams into the run's dataset.
4. Export from **Storage → Dataset** as JSON, CSV, or Excel — or fetch via the API.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|:--:|---|---|
| `coordinates` | `array` | **yes** | \['39.7456,-97.0892', '40.7128,-74.0060', '34.0522,-118.2437'] | US latitude/longitude pairs to look up, one per entry, formatted as <code>lat,lon</code> (e.g.… |
| `include_hourly_forecast` | `boolean` | no | False | Opt in to also fetch the per-hour forecast for each coordinate. Off by default — the hourly payload is large (~156… |
| `max_hourly_periods` | `integer` | no | 24 | When hourly forecast is enabled, cap how many hourly periods (earliest-first) are kept per location. Ignored when… |
| `proxyConfiguration` | `object` | no | {'useApifyProxy': True} | Apify Proxy configuration. api.weather.gov shows no anti-bot signal, so this is house-style hygiene rather than a… |

#### Example input

```json
{
  "coordinates": [
    "39.7456,-97.0892",
    "40.7128,-74.0060",
    "34.0522,-118.2437"
  ],
  "include_hourly_forecast": false
}
```

### 📤 Output

Every row is one dataset item.

| Field | Type | Notes |
|---|---|---|
| `latitude` | `number` | Input latitude, echoed. |
| `longitude` | `number` | Input longitude, echoed. |
| `grid_id` | `string` | NWS forecast grid identifier (e.g. TOP), resolved from the coordinate via the points endpoint. |
| `grid_x` | `integer` | NWS forecast grid X coordinate. |
| `grid_y` | `integer` | NWS forecast grid Y coordinate. |
| `city` | `['string', 'null']` | Nearest NWS relative-location city, when published. |
| `state` | `['string', 'null']` | Nearest NWS relative-location state, when published. |
| `forecast_periods` | `array` | ~14 day/night 7-day forecast periods — name, start/end time, temperature, short/detailed forecast, wind. |
| `hourly_periods` | `array` | Hourly forecast periods, capped at max\_hourly\_periods; empty unless include\_hourly\_forecast is true. |
| `active_alerts` | `array` | Currently active NWS alerts for the location; an empty list is a normal successful result. |
| `alert_count` | `integer` | Number of active alerts (length of active\_alerts). |
| `retrieved_at` | `string` | ISO-8601 UTC timestamp when this row was scraped. |

#### Example output

```json
{
  "latitude": 39.7456,
  "longitude": -97.0892,
  "grid_id": "TOP",
  "grid_x": 31,
  "grid_y": 80,
  "city": "Concordia",
  "state": "KS",
  "forecast_periods": [
    {
      "name": "Overnight",
      "start_time": "2026-09-03T21:00:00-05:00",
      "end_time": "2026-09-04T06:00:00-05:00",
      "is_daytime": false,
      "temperature": 68,
      "temperature_unit": "F",
      "precipitation_probability": 20,
      "wind_speed": "10 mph",
      "wind_direction": "S",
      "short_forecast": "Partly Cloudy",
      "detailed_forecast": "Partly cloudy, with a low around 68."
    }
  ],
  "hourly_periods": [],
  "active_alerts": [],
  "alert_count": 0,
  "retrieved_at": "2026-09-03T14:32:10Z"
}
```

### 💰 Pricing

Pay-Per-Event — you pay only when these events fire:

| Event | USD | What it is |
|---|---:|---|
| `actor-start` | $0.2 | One-off warm-up charge per run |
| `location-scraped` | $0.005 | Per successfully joined location row (forecast + optional hourly + alerts) |

Example: 1 000 results at the rates above ≈ **$5.20**. No subscription, no minimum, no card to start — Apify gives every new account $5 of free credit.

### 🚧 Limitations

- US/NWS coverage only — no international forecasts.
- Forecast and active alerts only — no historical or archival weather data.
- No built-in geocoding — supply raw lat,lon coordinates; geocode addresses or ZIPs upstream.
- Up to 25 coordinates per run — batch across multiple runs for larger coordinate lists.
- Hourly forecast is opt-in and capped at 156 periods to bound payload size.

### ❓ FAQ

**Is this Actor limited to the US?**

Yes — it wraps NOAA/NWS's public API, which only covers US coordinates (all 50 states plus territories). A non-US coordinate is skipped cleanly, never a crash.

**What happens if a coordinate is out of NWS coverage?**

That location is skipped, a WARNING is logged, and the run's status message states how many of your N coordinates were skipped and why. The run still succeeds with the rows that resolved.

**Does this include historical weather?**

No — this is forecast plus currently active alerts only, not a climate archive.

**Do I need an API key?**

No. api.weather.gov is a free, keyless public API; every request identifies itself with a compliant User-Agent header.

### 💬 Your feedback

Spotted a bug, hit a weird edge case, or need a new field? Open an
issue on the Actor's **Issues** tab on Apify Console — we ship
fixes weekly and we read every report.

***

<div align="center">

Built by **[Devil Scrapes](https://apify.com/DevilScrapes)** 😈 — a small fleet of
opinionated public-data Actors. Honest pricing, real engineering, zero fine print.

</div>

# Actor input Schema

## `coordinates` (type: `array`):

US latitude/longitude pairs to look up, one per entry, formatted as <code>lat,lon</code> (e.g. <code>39.7456,-97.0892</code>). 1–25 coordinates per run.

## `include_hourly_forecast` (type: `boolean`):

Opt in to also fetch the per-hour forecast for each coordinate. Off by default — the hourly payload is large (~156 periods per point) and this keeps runs fast and cheap.

## `max_hourly_periods` (type: `integer`):

When hourly forecast is enabled, cap how many hourly periods (earliest-first) are kept per location. Ignored when hourly forecast is off.

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

Apify Proxy configuration. api.weather.gov shows no anti-bot signal, so this is house-style hygiene rather than a survival requirement.

## Actor input object example

```json
{
  "coordinates": [
    "39.7456,-97.0892",
    "40.7128,-74.0060",
    "34.0522,-118.2437"
  ],
  "include_hourly_forecast": false,
  "max_hourly_periods": 24,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# 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 = {
    "coordinates": [
        "39.7456,-97.0892",
        "40.7128,-74.0060",
        "34.0522,-118.2437"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/noaa-weather-forecast-alerts-scraper").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 = {
    "coordinates": [
        "39.7456,-97.0892",
        "40.7128,-74.0060",
        "34.0522,-118.2437",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/noaa-weather-forecast-alerts-scraper").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 '{
  "coordinates": [
    "39.7456,-97.0892",
    "40.7128,-74.0060",
    "34.0522,-118.2437"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call devilscrapes/noaa-weather-forecast-alerts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devilscrapes/noaa-weather-forecast-alerts-scraper"
        }
    }
}

```

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/erakDWES2zBfXpD9T/builds/cf48us09gXYQXvQD9/openapi.json
