Alerts

Get a single NWS alert by id.

Changed on

Returns the full alert detail (geometry, spatial metadata, affected population, etc.) for a single NWS alert. Use the id of an alert in alerts[] from GET /v1/alerts. Accepts either a group_id (the alert's canonical id, stable across its updates) or a message_id (one NWS message in that alert); callers do not need to disambiguate.

Caching

A successful response carries Cache-Control: max-age=60, so an updated or cancelled alert can be served from a cache for up to 60 seconds. Partner keys get private, max-age=60: your own client may reuse the response for the full max-age, but shared caches (CDNs, proxies) must not store it, since each request on a partner key is metered and rate-limited individually.

Geometry

geometry is a GeoJSON object embedded in the response. Clients should treat it as opaque GeoJSON: forward-compat fields the upstream pipeline adds without a sw-api release pass through unchanged.

Places and areas (experimental)

representative_place is a named point inside the alert area and areas lists each UGC zone the alert names, with a point inside each resolved zone. Both are x-stability: experimental, optional, and returned only by this endpoint.

Auth

Standard sw-api Bearer auth applies.

get/v1/alerts/{id}

Request

  • Base URL
    https://api.smarterweather.com
  • Auth
    HTTP bearer

Path parameters

id, string required

Alert identifier: the id of an alert in alerts[] from GET /v1/alerts, or an alert's group_id or message_id. URL-encode embedded colons and slashes.

Query parameters

include, string

Comma-separated tokens. impact opts in to civic POI and building-count estimates (pois, buildings). Unknown tokens are ignored. Omitted on the default response so the lookup stays a primary-key read.

Response

Alert detail for the requested id.

AlertDetail required

Full alert representation returned by GET /v1/alerts/{id}. Supersets Alert with full description, instruction, geometry, spatial metadata (centroid, recommended zoom, affected population), the upstream NWS VTEC identifier, and path-impact (pois, buildings) when it was computed.

group_id, string required

The alert's canonical id, stable across its updates (the NWS id of its first message).

message_id, string required

NWS-issued message identifier (matches Alert.id).

status, string required

Alert lifecycle status (e.g., Actual, Exercise, Test).

event, string required
severity, 'Extreme' | 'Severe' | 'Moderate' | 'Minor' | 'Unknown' required
urgency, 'Immediate' | 'Expected' | 'Future' | 'Past' | 'Unknown' required
certainty, 'Observed' | 'Likely' | 'Possible' | 'Unlikely' | 'Unknown' required
headline, string required
description, string

Multi-paragraph human-readable forecast / hazard description. Line endings vary by NWS office; clients should treat as opaque text.

instruction, string

Recommended actions (NWS-issued instruction text).

sender, string required

Issuing NWS office identifier.

effective, string date-time required
expires, string date-time required
onset, string date-time required
ends, string date-time required
expiration, string date-time required

Final expiration time used for cache invalidation.

area_desc, string

Human-readable affected area.

highlights, object

Map of salient callouts extracted from the alert text (e.g., {"hazard": "Strong winds", "impact": "Loose debris possible"}).

geometry, object

GeoJSON geometry (Polygon / MultiPolygon) for the affected area when stored upstream. Treat as opaque GeoJSON; forward-compat fields the pipeline adds without a sw-api release pass through unchanged.

centroid_lat, number double

Centroid latitude of the affected geometry.

centroid_lon, number double

Centroid longitude of the affected geometry.

recommended_zoom, integer

Suggested map zoom level when rendering the alert detail.

affected_population, integer

Estimated population intersecting the alert geometry.

timezone, string

IANA timezone of the affected area (e.g., America/Chicago).

vtec_id, string

Upstream NWS VTEC identifier (when present). Useful for joining against external VTEC datasets; null for alerts without a VTEC code.

event_ending_time, string

Optional ending-time hint. Currently always omitted; clients should fall back to expires. Reserved for forward-compat.

pois, object

Civic POIs inside the alert polygon, computed once when the alert is written and stored on the alert. Present only when the request includes include=impact. features are capped at 50. Omitted when unavailable (null geometry, timeout, or estimate error) or when impact was not requested. Empty counts/features means computed zero, not unknown.

buildings, object

ACS housing units and Overture building-class counts inside the alert polygon, computed once when the alert is written and stored on the alert. Present only when the request includes include=impact. housing_unit is ACS B25001, not residences. Class keys (residential, commercial, industrial, civic, other) appear only when building-class data is available. features is currently always empty. Omitted when unavailable (no housing data, timeout, or estimate error) or when impact was not requested. counts.housing_unit: 0 is computed zero, not unknown.

representative_place, AlertRepresentativePlace

Experimental (x-stability: experimental): excluded from the 90-day breaking-change commitment; the selection rule may be tuned.

A named point inside the alert area, for landing a map or a location page on the alert. source: census_place is the most populous Census place inside the area; otherwise source: area_point is a point inside the area named for its zone. Omitted when the alert has no geometry, when no name resolves, or when the value is unavailable. Independent of areas: either can be present without the other.

Detail-only: never returned by GET /v1/alerts, including as-of (at=) reads.

areas, AlertArea[]

Experimental (x-stability: experimental): excluded from the 90-day breaking-change commitment.

One entry per UGC code the alert names, in first-seen order. Derived from the alert's UGC codes only: deduplicated (so areas[i] does not pair with a raw UGC list or an area_desc segment), and present even when representative_place is not. A code the platform cannot resolve is named by its UGC and has no lat/lon. A resolved zone, marine zones included, carries a point inside both the zone and the alert's area, so the point's location page shows the alert; it has no lat/lon when the zone does not overlap the alert's area, or when no such point could be computed. Omitted when no usable entry exists (an alert with no UGC codes included) or when the value is unavailable; clients fall back to area_desc.

Typically a handful of entries; can reach about 100 for large advisories (at most 1000).

Detail-only: never returned by GET /v1/alerts, including as-of (at=) reads.

Example response

{
  "group_id": "urn:oid:2.49.0.1.840.0.d1e1a911ed0a8ca7b56a9e6a3c5d6ba0035c88fb.001.1",
  "message_id": "urn:oid:2.49.0.1.840.0.d1e1a911ed0a8ca7b56a9e6a3c5d6ba0035c88fb.001.1",
  "event": "Severe Thunderstorm Warning",
  "representative_place": {
    "name": "Whiteriver, AZ",
    "lat": 33.837,
    "lon": -109.9643,
    "population": 4520,
    "source": "census_place"
  },
  "areas": [
    {
      "ugc": "AZC001",
      "name": "Apache",
      "lat": 35.3957,
      "lon": -109.4888
    }
  ]
}

Changes

    • info

      added the optional property allOf[#/components/schemas/Problem]/alternatives to the response with the status

    • info

      added the optional property alternatives to the response with the status

    • info

      added the optional property alternatives to the response with the status

    7 more changes in this revision