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#
| Endpoint | What it does | Parameters | Credits | Status |
|---|---|---|---|---|
alert_types | All NWS alert event types. | - | 5 | stable |
alerts_point | Active weather alerts covering a US point. | lat*, lon* | 5 | stable |
alerts_state | Active weather alerts for a US state/territory (2-letter code). | area* | 5 | stable |
forecast | 12-hour period forecast (7 days) for an NWS grid point. | office*, x*, y* | 5 | stable |
forecast_hourly | Hourly forecast (156 h) for an NWS grid point. | office*, x*, y* | 5 | stable |
glossary | NWS weather glossary (term and definition). | - | 5 | stable |
grid_stations | Observation stations near an NWS grid point. | office*, x*, y* | 5 | stable |
observation_latest | Latest observation at a station (temperature, wind, pressure, humidity). | station* | 1 | stable |
point | Resolve a US lat/lon to its NWS grid, forecast office, city and time zone. | lat*, lon* | 1 | stable |
product_types | NWS text product types (code and name). | - | 5 | stable |
radar_stations | NWS radar stations (WSR-88D and others). | - | 5 | stable |
station | One NWS observation station by id (e.g. KTOP). | station* | 1 | stable |
zone | One NWS forecast zone by id (e.g. KSZ022). | zone* | 1 | stable |
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.
| Field | Type | Endpoints |
|---|---|---|
entity.name | string | 13 |
entity.id | string | 11 |
entity.category | string | 8 |
entity.date | ISO 8601 date | 5 |
entity.description | string | 5 |
place.timeZone | string | 5 |
content.createdAt | ISO 8601 date | 4 |
entity.url | URL | 4 |
place.elevationM | number | 3 |
place.lat | number | 3 |
place.lon | number | 3 |
author.displayName | string | 2 |
content.text | string | 2 |
media.thumbnailUrl | URL | 2 |
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.