# NOAA Weather Alert Monitor (`ryanclinton/noaa-weather-alerts`) Actor

NOAA Weather Alert Monitor queries the official National Weather Service API (`api.weather.gov`) to retrieve weather alerts across all US states and territories. It operates in two distinct modes.

- **URL**: https://apify.com/ryanclinton/noaa-weather-alerts.md
- **Developed by:** [Ryan Clinton](https://apify.com/ryanclinton) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 23 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 alert fetcheds

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

## NOAA Weather Alert Monitor

### What does NOAA Weather Alert Monitor do?

NOAA Weather Alert Monitor queries the official National Weather Service API (`api.weather.gov`) and turns raw alerts into **scored, ranked decisions**. Most weather-alert tools hand you the CAP feed and leave you to read it; this one scores every alert on the standard severity × urgency × certainty matrix, maps the NWS `response` field to an operational `recommendedAction` (take-shelter, evacuate, avoid-area, monitor), flags which alerts actually need attention, and returns a run-level summary of what's happening across your area — so an automation or dashboard can branch on a number and an enum instead of parsing prose.

It operates in two distinct modes. **Active mode** (the default) fetches all currently live warnings, watches, and advisories in real time. **Historical mode** searches recent past alerts within a specified date range — useful for post-event analysis, insurance risk assessment, and climate research. Set a **watchlist name** to turn on cross-run monitoring: each run is compared to the last, flagging new, escalated, downgraded, cancelled, and resolved alerts for a location. Each alert record carries the full CAP payload — headline, safety instructions, affected areas, SAME and UGC geocodes, issuing NWS office, timing fields — plus the decision layer on top. The NWS API is free, open, and requires no API key.

### Why use NOAA Weather Alert Monitor on Apify?

- **No API key or authentication required** -- the NWS API is completely free and open. This actor handles all communication, required headers, pagination, and data transformation automatically.
- **Structured, normalized output** -- raw NOAA GeoJSON responses with deeply nested properties are transformed into clean, flat JSON records ready for processing, filtering, and export.
- **Automatic cursor-based pagination** -- the actor follows NWS pagination links to retrieve complete result sets, handling up to 5,000 alerts across up to 20 API pages per run.
- **Scheduled monitoring** -- run on a recurring Apify schedule (every 15 minutes, hourly, daily) to build a continuous weather alert feed with zero infrastructure.
- **Cloud execution with integrations** -- no servers or cron jobs needed. Built-in REST API access, webhook triggers, and integrations to Slack, Google Sheets, Zapier, and more.

### Key features

- **Deterministic priority scoring** -- every alert gets a 0-100 `alertPriority` from the standard CAP matrix (severity 50%, urgency 30%, certainty 20%) plus a `priorityLevel` band (critical / high / moderate / low / informational). No LLM, no randomness — the same alert always scores the same, with a `priorityFactors` breakdown showing how.
- **Operational recommended action** -- `recommendedAction` maps the NWS `response` field to a routing enum (take-shelter, evacuate, avoid-area, prepare, monitor, all-clear, no-action) and `actionRequired` is a one-field automation gate.
- **Timing intelligence** -- `timing.status` (active / upcoming / expired), minutes-until-onset, minutes-until-expiry, and an `expiringSoon` flag, so you can tell what's happening *now* from what starts in six hours.
- **Cross-run monitoring** -- set a `watchlistName` and each run is diffed against the last: `changeFlag` (NEW / UPDATED / ESCALATED / DOWNGRADED / CANCELLED / UNCHANGED), priority delta, and a resolved-alert list when warnings clear.
- **Run-level summary record** -- one `recordType: "summary"` record with the headline, critical count, action-required count, the highest-priority alert, breakdowns by level/severity/event/category, and the next alert to expire (also pinned to the `SUMMARY` key-value record).
- **Dual-mode operation** -- active alerts for real-time monitoring, or historical search with date ranges for research and trend analysis.
- **Three-dimensional NWS filtering** -- filter by severity, urgency, and certainty at the API, plus a post-scoring `minPriority` worklist filter and an `outputProfile` (minimal / standard / full).
- **State and territory filtering** -- any US state or territory by two-letter code (CA, TX, FL, PR, GU, etc.) or empty for nationwide.
- **SAME and UGC geocodes** -- FIPS county codes (SAME) and NWS zone codes (UGC) for county-level geographic targeting.
- **Up to 5,000 alerts per run** -- configurable `maxResults` cap with automatic cursor pagination.

### How to use NOAA Weather Alert Monitor

1. Go to the [NOAA Weather Alert Monitor](https://apify.com/ryanclinton/noaa-weather-alerts) page on Apify and click **Start**.
2. Choose your mode: leave **Active Alerts Only** checked for live monitoring, or uncheck it for historical search.
3. Enter a **State/Territory Code** (e.g., `TX` for Texas) or leave empty for all US alerts.
4. Optionally set **Severity**, **Urgency**, **Certainty**, or **Event Type** filters.
5. For historical mode, set **Start Date** and **End Date** in `YYYY-MM-DD` format.
6. Set **Max Results** (default 100, up to 5,000).
7. Click **Start** and wait for results (typically 5--30 seconds).
8. Download results from the **Dataset** tab in JSON, CSV, Excel, or XML format.
9. Optionally, set up a **recurring schedule** (e.g., every 15 minutes) for continuous monitoring.
10. Access results programmatically via the **Apify API** or connect integrations (Slack, webhooks, Google Sheets, Zapier).

### Input parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `activeOnly` | Boolean | `true` | When checked, returns only currently active alerts via `/alerts/active`. Uncheck for historical search with date range filters via `/alerts`. |
| `area` | String | `"CA"` (prefill) | Two-letter US state or territory code (e.g., `CA`, `TX`, `FL`, `NY`, `PR`). Automatically uppercased. Leave empty for all US alerts. |
| `severity` | Select | -- | Filter by severity: `Extreme`, `Severe`, `Moderate`, `Minor`, or `Unknown`. |
| `urgency` | Select | -- | Filter by urgency: `Immediate`, `Expected`, `Future`, `Past`, or `Unknown`. |
| `certainty` | Select | -- | Filter by certainty: `Observed`, `Likely`, `Possible`, `Unlikely`, or `Unknown`. |
| `eventType` | String | -- | Specific NWS event type (e.g., `Tornado Warning`, `Flash Flood Warning`, `Winter Storm Watch`). Must match NWS naming exactly. |
| `startDate` | String | -- | Start date in `YYYY-MM-DD` format. Only used when `activeOnly` is unchecked (historical mode). Converted to `T00:00:00Z`. |
| `endDate` | String | -- | End date in `YYYY-MM-DD` format. Only used when `activeOnly` is unchecked (historical mode). Converted to `T23:59:59Z`. |
| `maxResults` | Integer | `100` | Maximum number of alerts to return (1--5,000). |
| `minPriority` | Integer | -- | Only output alerts scoring at or above this `alertPriority` (0--100). The run summary still counts every alert; suppressed alerts are logged. |
| `watchlistName` | String | -- | Set a name to turn on cross-run monitoring for a location/query. Each run is compared to the last under this name. Leave empty for a one-off run. |
| `outputProfile` | Select | `standard` | `minimal` (decision fields only), `standard` (decisions + core alert fields), or `full` (every field). |

#### Input examples

**Active severe alerts in Texas:**

```json
{
    "activeOnly": true,
    "area": "TX",
    "severity": "Severe",
    "maxResults": 50
}
```

**Historical tornado warnings with date range:**

```json
{
    "activeOnly": false,
    "area": "OK",
    "eventType": "Tornado Warning",
    "startDate": "2025-04-01",
    "endDate": "2025-04-30",
    "maxResults": 500
}
```

**Extreme urgency with observed certainty:**

```json
{
    "activeOnly": true,
    "area": "FL",
    "severity": "Extreme",
    "urgency": "Immediate",
    "certainty": "Observed",
    "maxResults": 100
}
```

**All active alerts nationwide (no filters):**

```json
{
    "activeOnly": true,
    "maxResults": 1000
}
```

**Monitor Florida for high-priority alerts (cross-run change detection):**

```json
{
    "activeOnly": true,
    "area": "FL",
    "minPriority": 60,
    "watchlistName": "florida-ops",
    "outputProfile": "minimal"
}
```

Run this on a schedule under the same `watchlistName` and each run flags what is NEW, ESCALATED, or RESOLVED since the last one — only emitting alerts scoring 60+.

#### Tips for best results

- **Active mode is best for monitoring** -- it returns only currently live alerts and responds faster since the NWS active endpoint is optimized for real-time queries.
- **Date filters are ignored in active mode** -- `startDate` and `endDate` only apply when `activeOnly` is unchecked. This is by design of the NWS API.
- **Event type strings must match exactly** -- use official NWS event names like `Tornado Warning`, `Flood Watch`, or `Winter Storm Warning`. Partial matches and case variations do not work.
- **State codes are case-insensitive** -- the actor automatically uppercases the `area` parameter, so `ca`, `Ca`, and `CA` all work identically.
- **Combine all three filter dimensions** for the most targeted monitoring. Setting severity to `Extreme`, urgency to `Immediate`, and certainty to `Observed` captures only confirmed, life-threatening events in progress.
- **Schedule runs every 15--30 minutes** for continuous monitoring. Connect a webhook or Slack integration to receive notifications when new severe alerts appear.

### Output example

Each alert is output as a flat JSON object combining the raw CAP fields with the decision layer. Here is a realistic tornado warning (standard profile):

```json
{
    "recordType": "alert",
    "schemaVersion": "2.0.0",
    "alertPriority": 95,
    "priorityLevel": "critical",
    "recommendedAction": "take-shelter",
    "actionRequired": true,
    "messageStatus": "new",
    "isCancellation": false,
    "timing": {
        "status": "active",
        "minutesUntilOnset": null,
        "minutesUntilExpiry": 37,
        "durationHours": 0.6,
        "expiringSoon": true
    },
    "priorityFactors": {
        "severity": { "value": "Extreme", "contribution": 50 },
        "urgency": { "value": "Immediate", "contribution": 30 },
        "certainty": { "value": "Observed", "contribution": 20 }
    },
    "whyItMatters": "Tornado Warning (Extreme/Immediate) for Cleveland, OK. In effect for ~37 min more.",
    "summary": "CRITICAL: Tornado Warning for Cleveland, OK. Recommended: take-shelter.",
    "alertId": "urn:oid:2.49.0.1.840.0.2025.04.15.14.23.0045",
    "event": "Tornado Warning",
    "headline": "Tornado Warning issued April 15 at 2:23PM CDT by NWS Norman OK",
    "severity": "Extreme",
    "urgency": "Immediate",
    "certainty": "Observed",
    "category": "Met",
    "status": "Actual",
    "response": "Shelter",
    "areaDesc": "Cleveland, OK; McClain, OK",
    "senderName": "NWS Norman OK",
    "sent": "2025-04-15T14:23:00-05:00",
    "effective": "2025-04-15T14:23:00-05:00",
    "onset": "2025-04-15T14:23:00-05:00",
    "expires": "2025-04-15T15:00:00-05:00",
    "ends": "2025-04-15T15:00:00-05:00",
    "sameCodes": "040027|040087",
    "ugcCodes": "OKC025|OKC087",
    "nwsHeadline": "TORNADO WARNING IN EFFECT UNTIL 300 PM CDT",
    "changeFlag": null,
    "extractedAt": "2025-04-15T19:24:12.345Z"
}
```

When `watchlistName` is set, `changeFlag`, `previousPriority`, `priorityDelta`, and `runsSeen` are populated instead of null. Every run also emits one `recordType: "summary"` record (and, in watchlist mode, a `recordType: "watchlist-summary"` record).

### Output fields reference

**Decision layer** (added by this actor on top of the raw CAP fields):

| Field | Type | Description |
|-------|------|-------------|
| `recordType` | String | `alert`, `summary`, `watchlist-summary`, `no-results`, or `error`. |
| `alertPriority` | Number | 0--100 deterministic CAP priority (severity 50% + urgency 30% + certainty 20%). Sort key. |
| `priorityLevel` | String | Band: `critical`, `high`, `moderate`, `low`, `informational`. |
| `recommendedAction` | String | `take-shelter`, `evacuate`, `avoid-area`, `prepare`, `execute-instructions`, `assess`, `monitor`, `all-clear`, `no-action`. |
| `actionRequired` | Boolean | True when critical/high, in effect, and not cancelled. Automation gate. |
| `messageStatus` | String | `new`, `update`, `cancellation`, `acknowledgement`, `error` (from CAP messageType). |
| `isCancellation` | Boolean | True when the message withdraws a prior alert. |
| `timing` | Object | `{ status, minutesUntilOnset, minutesUntilExpiry, durationHours, expiringSoon }`. |
| `priorityFactors` | Object | Per-axis contribution to the score (`severity`, `urgency`, `certainty`). |
| `priorityReason` | String\[] | Plain-English reasons behind the score (dropped in standard/minimal profiles). |
| `whyItMatters` | String | One-line plain-English context (event, severity/urgency, area, timing). |
| `summary` | String | LLM-friendly one-line decision summary. |
| `changeFlag` | String/null | Watchlist mode: `NEW`, `UPDATED`, `ESCALATED`, `DOWNGRADED`, `CANCELLED`, `UNCHANGED`. Null when off. |
| `previousPriority` | Number/null | Priority on the prior run (watchlist mode). |
| `priorityDelta` | Number/null | Change in priority since the last run (watchlist mode). |
| `runsSeen` | Number/null | Runs this alert has appeared in (watchlist mode). |

**Raw CAP fields** (from the NWS alert):

| Field | Type | Description |
|-------|------|-------------|
| `alertId` | String | Unique NWS alert identifier in URN OID format. |
| `event` | String | NWS event type name (e.g., `Tornado Warning`, `Flood Watch`). |
| `headline` | String/null | Human-readable headline with event type, date/time, and issuing office. |
| `severity` | String | Severity level: `Extreme`, `Severe`, `Moderate`, `Minor`, or `Unknown`. |
| `urgency` | String | Urgency level: `Immediate`, `Expected`, `Future`, `Past`, or `Unknown`. |
| `certainty` | String | Certainty level: `Observed`, `Likely`, `Possible`, `Unlikely`, or `Unknown`. |
| `category` | String | CAP alert category (e.g., `Met` for meteorological, `Geo` for geophysical). |
| `status` | String | Alert status: `Actual`, `Exercise`, `System`, `Test`, or `Draft`. |
| `messageType` | String | Message type: `Alert`, `Update`, or `Cancel`. |
| `response` | String | Recommended action: `Shelter`, `Evacuate`, `Prepare`, `Monitor`, `AllClear`, or `None`. |
| `areaDesc` | String | Human-readable description of affected areas (counties, zones, cities). |
| `senderName` | String | Name of the issuing NWS forecast office (e.g., `NWS Norman OK`). |
| `sender` | String | Email address of the sending NWS office. |
| `sent` | String | ISO 8601 timestamp when the alert was sent. |
| `effective` | String | ISO 8601 timestamp when the alert becomes effective. |
| `onset` | String/null | ISO 8601 timestamp of expected event onset. Null if not specified. |
| `expires` | String | ISO 8601 timestamp when the alert expires. |
| `ends` | String/null | ISO 8601 timestamp when the event is expected to end. Null if not specified. |
| `description` | String | Full NWS hazard description with event details, source, and expected impact. |
| `instruction` | String/null | Official safety instructions and recommended protective actions. Null if not provided. |
| `sameCodes` | String | SAME (Specific Area Message Encoding) FIPS county codes for EAS broadcast targeting, pipe-separated. |
| `ugcCodes` | String | UGC (Universal Geographic Code) NWS zone/county identifiers, pipe-separated. |
| `nwsHeadline` | String/null | Condensed NWS headline extracted from nested alert parameters. Null if not present. |
| `extractedAt` | String | ISO 8601 timestamp when this record was extracted by the actor. |

### How it works

```
Input Config
    |
    v
Select Endpoint ──> activeOnly=true?  ──yes──> /alerts/active
    |                                   ──no──> /alerts (+ date params)
    v
Build Query Params (area, severity, urgency, certainty, event)
    |
    v
Fetch Page ──> User-Agent + Accept: application/geo+json
    |
    v
Parse GeoJSON Features ──> pagination.next exists? ──yes──> Follow cursor URL
    |                       (cap: 20 pages)          ──no──> Continue
    v
Transform Each Feature ──> Flatten properties, extract geocodes + NWSheadline
    |
    v
Push to Apify Dataset + Log Summary (event types, severity counts, sources)
```

#### Dual-endpoint architecture

The NWS API exposes two separate alert endpoints. The actor selects between them based on the `activeOnly` flag:

- **`/alerts/active`** (default) -- returns only currently live alerts. This endpoint is faster and returns smaller payloads because expired alerts are excluded server-side.
- **`/alerts`** -- returns both active and historical alerts. This endpoint accepts `start` and `end` date query parameters for time-range searches.

When `activeOnly` is `true` (or unset), the actor uses the active endpoint. Setting `activeOnly` to `false` switches to the full alerts endpoint with date filter support.

#### Date filter restriction

The `startDate` and `endDate` parameters are only appended to the request URL when `activeOnly` is explicitly `false`. This matches the NWS API design: the `/alerts/active` endpoint does not accept date parameters since all returned alerts are, by definition, currently active. Date values are formatted with time suffixes -- `T00:00:00Z` for start and `T23:59:59Z` for end -- to cover complete days in UTC.

#### Cursor-based pagination

Unlike page-number pagination, the NWS API uses cursor-based pagination. Each API response may include a `pagination.next` URL pointing to the next batch of results. The actor follows these URLs sequentially until one of three conditions is met: no `next` URL is present, the `maxResults` cap is reached, or a safety limit of 20 pages is hit. This approach is more reliable than offset-based pagination because it handles data that changes between requests.

#### NWS headline extraction

NWS alerts contain a nested `parameters` object with additional metadata. The `NWSheadline` field (accessed at `parameters.NWSheadline[0]`) provides a condensed, uppercase headline that is distinct from the main `headline` field. The actor extracts this into the `nwsHeadline` output field. This headline is typically shorter and more direct, making it useful for notification subject lines and dashboard displays.

#### SAME and UGC geocode extraction

Each alert includes a `geocode` object with two code systems. **SAME codes** (Specific Area Message Encoding) are six-digit FIPS county codes used by the Emergency Alert System for broadcast targeting on TV, radio, and wireless devices. **UGC codes** (Universal Geographic Code) are NWS-specific zone and county identifiers used in forecast operations. The actor extracts both arrays from the nested `geocode` object, defaulting to empty arrays when codes are absent.

#### User-Agent requirement

The NWS API requires a valid `User-Agent` header on all requests. Requests without this header are rejected with a 403 error. The actor sends `apify-noaa-weather-alerts/1.0 (ryanclinton@apify.com)` to comply with this requirement, along with an `Accept: application/geo+json` header to receive GeoJSON-formatted responses.

#### Decision layer

After each alert is fetched, the actor scores it deterministically — no LLM, no randomness — from the CAP fields the NWS already publishes:

- **`alertPriority` (0--100)** = severity (50%) + urgency (30%) + certainty (20%), each from a fixed weight table, with the per-axis contribution exposed in `priorityFactors`. `priorityLevel` bands it into critical / high / moderate / low / informational.
- **`recommendedAction`** maps the CAP `response` field (Shelter, Evacuate, Avoid, Prepare, Monitor, AllClear) to a stable routing enum; `actionRequired` is true only for in-effect critical/high alerts that have not been cancelled.
- **`timing`** parses onset/effective and expires/ends against the current time into a status (active / upcoming / expired), minutes-until, and an `expiringSoon` flag.

Alerts are streamed highest-priority first.

#### Run summary record

After processing all alerts, the actor emits one `recordType: "summary"` record (also pinned to the `SUMMARY` key-value record) containing:

- **`headline`** -- a one-line read of the run (e.g. "2 critical alerts for TX — Tornado Warning highest priority").
- **`criticalCount` / `actionRequiredCount`** and breakdowns `byPriorityLevel`, `bySeverity`, `byEvent` (top 15), `byCategory`.
- **`topAlert`** -- the highest-priority alert, and **`nextToExpire`** -- the active alert closest to expiry.

### How much does it cost to run?

The NWS API is completely free with no usage fees. The only cost is Apify platform compute time. Since the actor makes lightweight HTTP requests with no browser rendering, runs are very fast and inexpensive.

| Scenario | Estimated alerts | Estimated time | Estimated cost |
|----------|-----------------|----------------|----------------|
| Active alerts for one state | 5--100 | ~5 seconds | ~$0.001 |
| Active alerts nationwide | 200--2,000 | ~15 seconds | ~$0.005 |
| Historical search with date range | 500--5,000 | ~30 seconds | ~$0.01 |

Costs are based on Apify platform usage at standard rates with 256 MB memory. Actual costs depend on alert volume and pagination depth. Scheduled monitoring (e.g., every 15 minutes, 24/7) costs approximately $0.10/day.

### Limitations and responsible use

- **US-only coverage** -- the NWS API covers the 50 US states, DC, and US territories (PR, GU, VI, AS, MP). International weather alerts are not available.
- **Historical depth is limited** -- the NWS API retains historical alerts for a limited window (typically days to weeks). It is not a long-term archive.
- **Event type exact match** -- the `eventType` filter requires the exact NWS event name string. Typos, partial names, or case variations return no results.
- **Pagination safety limit** -- the actor follows up to 20 pages of cursor-based pagination. Extremely broad queries exceeding this are truncated.
- **No geometry data** -- the actor extracts alert properties but does not include GeoJSON polygon coordinates. Use the NWS API directly if you need geographic boundaries.
- **Update handling** -- an updated alert (`messageType: Update`) carries `messageStatus: "update"`; in watchlist mode it is flagged `changeFlag: "UPDATED"`. Within a single run the actor does not merge an update onto its original — both records appear.
- **Not a substitute for official warnings** -- this is a data and decision-support tool for monitoring and research. The `recommendedAction` is operational routing derived from the NWS `response` field, not life-safety advice. For life-safety decisions, always rely on official NWS alerts at [weather.gov](https://www.weather.gov).
- **API availability** -- the NWS API may experience degraded performance during severe weather events when demand is highest. The actor retries transient failures with backoff and, if the API stays unavailable, emits a typed `error` record and finishes successfully rather than crashing the run.
- **Date precision** -- `startDate` and `endDate` are converted to full ISO 8601 timestamps (`T00:00:00Z` and `T23:59:59Z`). Sub-day time precision is not supported through the actor input.

#### NWS alert severity levels

| Level | Description |
|-------|-------------|
| Extreme | Extraordinary threat to life or property |
| Severe | Significant threat to life or property |
| Moderate | Possible threat to life or property |
| Minor | Minimal or no known threat to life or property |
| Unknown | Severity is unknown at the time of issuance |

#### NWS alert urgency levels

| Level | Description |
|-------|-------------|
| Immediate | Responsive action should be taken immediately |
| Expected | Responsive action should be taken within the next hour |
| Future | Responsive action should be taken in the near future |
| Past | Responsive action is no longer required |
| Unknown | Urgency is not determined or not applicable |

#### NWS alert certainty levels

| Level | Description |
|-------|-------------|
| Observed | Event has been observed or confirmed (e.g., tornado sighted) |
| Likely | Probability greater than 50% the event will occur |
| Possible | Probability between 25% and 50% the event will occur |
| Unlikely | Probability less than 25% the event will occur |
| Unknown | Certainty is not determined or not applicable |

### API integration examples

Use the [Apify API](https://docs.apify.com/api/v2) to run the actor programmatically and retrieve results in your applications, pipelines, or automated workflows.

**Python:**

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("ryanclinton/noaa-weather-alerts").call(run_input={
    "activeOnly": True,
    "area": "TX",
    "severity": "Severe",
    "maxResults": 50,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"{item['event']}: {item['headline']}")
    print(f"  Severity: {item['severity']} | Urgency: {item['urgency']}")
    print(f"  Areas: {item['areaDesc']}")
    print()
```

**JavaScript:**

```javascript
import { ApifyClient } from "apify-client";

const client = new ApifyClient({ token: "YOUR_API_TOKEN" });

const run = await client.actor("ryanclinton/noaa-weather-alerts").call({
    activeOnly: true,
    area: "FL",
    severity: "Extreme",
    urgency: "Immediate",
    maxResults: 100,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const alert of items) {
    console.log(`${alert.event}: ${alert.headline}`);
    console.log(`  Instruction: ${alert.instruction}`);
}
```

**cURL:**

```bash
## Start the actor run
curl -X POST "https://api.apify.com/v2/acts/ryanclinton~noaa-weather-alerts/runs?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "activeOnly": false,
    "area": "CA",
    "eventType": "Flood Warning",
    "startDate": "2025-01-01",
    "endDate": "2025-01-31",
    "maxResults": 200
  }'

## Retrieve results (replace DATASET_ID from the run response)
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?token=YOUR_API_TOKEN&format=json"
```

### FAQ

**What types of weather alerts does this actor return?**
Every alert type issued by the National Weather Service, including Tornado Warnings, Severe Thunderstorm Warnings, Flash Flood Warnings, Flood Watches, Winter Storm Warnings, Blizzard Warnings, Ice Storm Warnings, Hurricane Warnings, Tropical Storm Warnings, Heat Advisories, Excessive Heat Warnings, High Wind Warnings, Wind Advisories, Fire Weather Watches, Red Flag Warnings, Dense Fog Advisories, Freeze Warnings, Frost Advisories, Tsunami Warnings, and dozens more. Any alert published through the NOAA Weather API is captured.

**What US states and territories are supported?**
All 50 US states, Washington DC, and US territories including Puerto Rico (PR), Guam (GU), US Virgin Islands (VI), American Samoa (AS), and Northern Mariana Islands (MP). Use standard two-letter postal codes.

**Can I search for multiple states at once?**
The NWS API `area` parameter accepts a single state code per request. To monitor multiple states, leave the `area` field empty to search all US alerts nationwide, or run the actor separately for each state.

**Why do my date filters have no effect?**
Date filters (`startDate` and `endDate`) only work in historical mode. Make sure `activeOnly` is set to `false`. When `activeOnly` is `true` (the default), the actor uses the `/alerts/active` endpoint which does not accept date parameters.

**How often are NWS alerts updated?**
The NWS updates alerts in near real-time. New alerts are typically available within seconds of issuance. For continuous monitoring, schedule the actor to run every 15--30 minutes.

**What are SAME codes and UGC codes?**
SAME codes are six-digit FIPS county identifiers used by the Emergency Alert System (EAS) for broadcast targeting on TV, radio, and wireless devices. UGC codes are NWS-specific zone and county codes used in forecast products. Both are useful for programmatic geographic matching and integration with emergency notification systems.

**How do I set up continuous weather monitoring?**
On the Apify platform, create a scheduled task that runs this actor at your desired interval (e.g., every 15 minutes). Configure a webhook or integration (Slack, email, Zapier, Google Sheets) to receive or store the output dataset after each run. This provides automated, continuous weather alert monitoring without any server infrastructure.

### Use in Dify

Drop this actor into [Dify](https://docs.apify.com/platform/integrations/dify) workflows via the Apify plugin's Run Actor node. Each alert returns scored, classified, and recommended as structured JSON — `critical` / `high` / `moderate` / `low` plus the `recommendedAction` and `actionRequired` your downstream node branches on. A generic weather-alert scraper pointed at the same NWS feed returns raw CAP JSON; this returns decisions.

- **Actor ID:** `ryanclinton/noaa-weather-alerts`
- **Sample input** (monitor a state for high-priority alerts, only surface what changed):

```json
{
    "activeOnly": true,
    "area": "FL",
    "minPriority": 60,
    "watchlistName": "florida-ops",
    "outputProfile": "minimal"
}
```

A Dify **if/else node** routes cleanly on the stable enums — no prose parsing:

- `recommendedAction == "take-shelter"` or `"evacuate"` → page the on-call / fire the emergency SMS branch
- `actionRequired == true` → escalate to a human; `false` → log only
- `priorityLevel == "critical"` → high-urgency channel; `"moderate"` / `"low"` → digest channel
- `changeFlag == "NEW"` or `"ESCALATED"` (watchlist mode) → alert; `"UNCHANGED"` → suppress, so a scheduled run only fires when something actually changed

Opt-in modes Dify workflows can lean on: set `watchlistName` to turn each scheduled run into a change feed (new / escalated / resolved alerts), and `minPriority` to keep only alerts worth acting on. The `recommendedAction` enum and the run-level `summary` record's `headline` are usable verbatim in a notification — no LLM rewriting needed.

### Related actors

| Actor | Description | Link |
|-------|-------------|------|
| FEMA Disaster Declaration Search | Search FEMA disaster declarations by state, type, and date range | [ryanclinton/fema-disaster-search](https://apify.com/ryanclinton/fema-disaster-search) |
| GDACS Disaster Alerts | Monitor global disaster alerts from earthquakes, floods, cyclones, and volcanoes | [ryanclinton/gdacs-disaster-alerts](https://apify.com/ryanclinton/gdacs-disaster-alerts) |
| UK Environment Agency Flood Warnings | Search active flood warnings and alerts across England | [ryanclinton/uk-flood-warnings](https://apify.com/ryanclinton/uk-flood-warnings) |
| Weather Forecast Search | Get detailed weather forecasts for any global location | [ryanclinton/weather-forecast-search](https://apify.com/ryanclinton/weather-forecast-search) |
| USGS Earthquake Search | Search recent and historical earthquake data from USGS | [ryanclinton/usgs-earthquake-search](https://apify.com/ryanclinton/usgs-earthquake-search) |
| Website Change Monitor | Monitor any weather-related web page for content changes | [ryanclinton/website-change-monitor](https://apify.com/ryanclinton/website-change-monitor) |

# Changelog

This Actor's version history is a separate document: https://apify.com/ryanclinton/noaa-weather-alerts/changelog.md

# Actor input Schema

## `activeOnly` (type: `boolean`):

Only return currently active alerts (recommended for monitoring). If unchecked, searches recent historical alerts.

## `area` (type: `string`):

Two-letter US state or territory code (e.g. CA, TX, FL, NY). Leave empty for all US alerts.

## `severity` (type: `string`):

Filter by alert severity level

## `urgency` (type: `string`):

Filter by urgency level

## `certainty` (type: `string`):

Filter by certainty level

## `eventType` (type: `string`):

Filter by specific event type (e.g. 'Tornado Warning', 'Winter Storm Watch', 'Flood Warning')

## `startDate` (type: `string`):

Search alerts from this date (YYYY-MM-DD). Only used when 'Active Only' is unchecked.

## `endDate` (type: `string`):

Search alerts until this date (YYYY-MM-DD). Only used when 'Active Only' is unchecked.

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

Maximum number of alerts to return

## `minPriority` (type: `integer`):

Only output alerts scoring at or above this priority on the CAP matrix (severity + urgency + certainty). Leave empty to return all. The run summary still counts every alert.

## `watchlistName` (type: `string`):

Set a name to turn on cross-run monitoring for a location/query. Each run is compared to the last under this name: new, escalated, downgraded, cancelled and resolved alerts are flagged. Leave empty for a one-off run.

## `outputProfile` (type: `string`):

minimal = decision fields only; standard = decisions + core alert fields (drops long description/instruction text); full = every field.

## Actor input object example

```json
{
  "activeOnly": true,
  "area": "CA",
  "maxResults": 100,
  "outputProfile": "standard"
}
```

# 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 = {
    "area": "CA",
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("ryanclinton/noaa-weather-alerts").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 = {
    "area": "CA",
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("ryanclinton/noaa-weather-alerts").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 '{
  "area": "CA",
  "maxResults": 100
}' |
apify call ryanclinton/noaa-weather-alerts --silent --output-dataset

```

## MCP server setup

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

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/BJTV7I8rfiNHa0PlD/builds/VUm3LIuGQLzPg8iGH/openapi.json
