# ToolMint NWS Alerts

> US National Weather Service active alerts as clean JSON — by state/area or lat/lon. No NWS API key.

- Status: Live
- Price: $0.005 / call (x402 exact, USDC on Base eip155:8453, payTo 0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5)
- Base URL: https://toolmint-nws-alerts.toolmint.workers.dev
- OpenAPI: https://toolmint.toolmint.workers.dev/tools/nws-alerts-json/openapi.json

## Routes

- `GET /alerts` $0.005: Active alerts by area or point query params
- `GET /alerts/area/{area}` $0.005: Active alerts by state/area code
- `GET /alerts/point` $0.005: Active alerts by lat/lon
- `GET /alerts/types` $0.005: Alert event types catalog

## What question it answers

"What weather alerts are active right now for this state, or for this point on the map?" Each alert has event, severity, certainty, urgency, headline, instructions and timing.

## When to use it

- You need current NWS alerts as flat JSON, not NWS GeoJSON.
- You want a count of alerts by severity for a state (`bySeverity`).

## When not to use it

- Life-safety decisions. This is a convenience copy of NWS data, up to 5 minutes old from cache. Use weather.gov and official channels for that.
- Forecasts or past weather. It lists only alerts that are active now.
- Places outside the US.
- The NWS API is free. You pay for the cleaned shape and for not writing the client.

## Example

```bash
curl -i "https://toolmint-nws-alerts.toolmint.workers.dev/alerts/area/TX?limit=2"
# HTTP 402 with a PAYMENT-REQUIRED header. Pay with an x402 client, then repeat the
# same request with the PAYMENT-SIGNATURE header.
```

Response after payment (trimmed; values are illustrative, field names come from the code):

```json
{
  "tool": "nws-alerts-json",
  "version": "0.1.0",
  "area": "TX",
  "count": 1,
  "bySeverity": { "Moderate": 1 },
  "alerts": [
    {
      "id": "https://api.weather.gov/alerts/urn:oid:...",
      "event": "Heat Advisory",
      "severity": "Moderate",
      "certainty": "Likely",
      "urgency": "Expected",
      "headline": "Heat Advisory issued ...",
      "description": "...",
      "descriptionTruncated": false,
      "instruction": "Drink plenty of fluids...",
      "instructionTruncated": false,
      "areaDesc": "Travis; Williamson",
      "sent": "2026-10-31T14:00:00-05:00",
      "effective": "2026-10-31T14:00:00-05:00",
      "onset": "2026-10-31T14:00:00-05:00",
      "expires": "2026-10-31T20:00:00-05:00",
      "ends": "2026-10-31T20:00:00-05:00",
      "status": "Actual",
      "messageType": "Alert",
      "senderName": "NWS Austin/San Antonio TX",
      "web": "http://www.weather.gov"
    }
  ],
  "source": "api.weather.gov (NWS)",
  "note": "US government public data. No API key.",
  "cached": false
}
```

`description` is cut at 1500 characters and `instruction` at 800; the `...Truncated` flags say when. The point route returns `point: {lat, lon}` instead of `area`, and has no `bySeverity`.

## Data source and licence

Source: api.weather.gov (US National Weather Service). US government work, generally public domain. Check the source's terms if you redistribute. Not endorsed by NWS.

## Freshness and limits

- Cached for 5 minutes per area or point, and the event-type list for 24 hours. `cached` tells you if you got a cache hit. There is no `fetchedAt` field yet.
- The cache lives in memory on one server instance, so a repeat call may or may not hit it.
- At most 100 alerts per call. There is no filter by severity or event.
- NWS test or exercise messages are not filtered out.
- If it runs out, paid calls fail and are not charged.
