NWS API

Get NWS data as clean JSON with one key: 13 endpoints, 1 to 5 credits per call, the same response shape as every other platform.

What you get#

Onekey exposes NWS as 13 endpoints behind one API key: 4 endpoints return one record (data is an object) and 9 endpoints return a list (data is an array). Every answer uses the same envelope (success, data, metadata, error), the cost is reported in metadata.credits_charged, and fields are mapped onto the unified schema so the code you write for NWS also works for the rest of the maps, weather & space category.

Endpoints#

EndpointWhat it doesParametersCreditsStatus
alert_typesAll NWS alert event types.-5stable
alerts_pointActive weather alerts covering a US point.lat*, lon*5stable
alerts_stateActive weather alerts for a US state/territory (2-letter code).area*5stable
forecast12-hour period forecast (7 days) for an NWS grid point.office*, x*, y*5stable
forecast_hourlyHourly forecast (156 h) for an NWS grid point.office*, x*, y*5stable
glossaryNWS weather glossary (term and definition).-5stable
grid_stationsObservation stations near an NWS grid point.office*, x*, y*5stable
observation_latestLatest observation at a station (temperature, wind, pressure, humidity).station*1stable
pointResolve a US lat/lon to its NWS grid, forecast office, city and time zone.lat*, lon*1stable
product_typesNWS text product types (code and name).-5stable
radar_stationsNWS radar stations (WSR-88D and others).-5stable
stationOne NWS observation station by id (e.g. KTOP).station*1stable
zoneOne NWS forecast zone by id (e.g. KSZ022).zone*1stable

A * marks a required parameter. Each endpoint name links to its reference page with the full parameter table, caching window and a recorded response.

Make a request#

This calls nws.observation_latest (1 credit, stable). Replace YOUR_API_KEY with your key; sign up, no card. 1,000 free credits cover the open-platform endpoints. Hard-to-reach platforms (X, TikTok, Instagram, Reddit, and others marked on their page) need a verified email and a purchased pack.

curl "https://api.onekey.dev/v1/nws/observation_latest?station=KTOP" \
  -H "x-api-key: YOUR_API_KEY"

Fields you get back#

These unified fields come back from NWS, with the same names as on every other platform. The count is how many of its 13 mapped endpoints return the field; a field the source lacks is null, never missing. 24 platform-specific fields (ext.<name>) come on top, documented on each endpoint page.

FieldTypeEndpoints
entity.namestring13
entity.idstring11
entity.categorystring8
entity.dateISO 8601 date5
entity.descriptionstring5
place.timeZonestring5
content.createdAtISO 8601 date4
entity.urlURL4
place.elevationMnumber3
place.latnumber3
place.lonnumber3
author.displayNamestring2
content.textstring2
media.thumbnailUrlURL2

The full schema is in Unified schema.

Pricing#

NWS calls cost 1 to 5 credits, flat per endpoint. Free when served from cache (0.2 credit for a cached response over 100 KB). Invalid, failed or not-found calls are not charged. See pricing for credit packs.