Weather APIforecast.weather.gov ↗
Retrieve current and historical weather observations from NWS stations. Get temperature, wind, pressure, humidity, METAR text, and station metadata via 3 endpoints.
What is the Weather API?
The forecast.weather.gov API exposes 3 endpoints for retrieving weather observation data from National Weather Service stations across the United States. get_latest_observation returns the most recent METAR-backed reading for a station, including temperature, dewpoint, wind speed, wind gust, visibility, heat index, and wind chill. get_station_info provides geographic coordinates, elevation, timezone, and forecast zone URL for any NWS station ID.
curl -X GET 'https://api.parse.bot/scraper/32ca19b7-5cd6-46e6-b430-cfd18657b011/get_latest_observation?station_id=KDFW' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace forecast-weather-gov-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: NWS SDK — weather observations from National Weather Service stations."""
from parse_apis.national_weather_service_api import NWS, StationNotFound
client = NWS()
# Fetch station metadata by ID — constructible resource, so .get() fetches full details.
station = client.stations.get(station_id="KDFW")
print(f"Station: {station.name}, Timezone: {station.timezone}")
# Get the latest observation from the fetched station (instance method).
obs = station.latest_observation()
print(f"Latest: {obs.text_description} at {obs.timestamp}")
print(f" Temp: {obs.temperature}, Humidity: {obs.relative_humidity}")
# List recent observations via the sub-resource, capped to 3 items.
for observation in station.observations.list(limit=3):
print(f" {observation.timestamp}: {observation.text_description}, wind={observation.wind_speed}")
# Typed error handling: attempt to fetch a non-existent station.
try:
client.stations.get(station_id="KZZZ")
except StationNotFound as exc:
print(f"Station not found: {exc.station_id}")
print("exercised: stations.get / latest_observation / observations.list / StationNotFound")
Get the most recent weather observation for a specified NWS station. Returns detailed meteorological data including temperature, dewpoint, wind, pressure, humidity, precipitation, and cloud layers. Each station reports every 5-15 minutes; the latest observation is the most recent report available.
| Param | Type | Description |
|---|---|---|
| station_id | string | NWS station identifier, a 4-character ICAO code (e.g. KATT, KDFW, KHOU, KJFK). Thousands of stations exist across the US. |
{
"type": "object",
"fields": {
"dewpoint": "object - Dewpoint with unitCode, value, qualityControl",
"timestamp": "string - Observation timestamp in ISO 8601 format",
"wind_gust": "object - Wind gust speed (value may be null)",
"heat_index": "object - Heat index temperature (value may be null)",
"station_id": "string - NWS station identifier",
"visibility": "object - Visibility in meters",
"wind_chill": "object - Wind chill temperature (value may be null)",
"wind_speed": "object - Wind speed with unitCode and value",
"raw_message": "string - Raw METAR observation message",
"temperature": "object - Temperature with unitCode, value, qualityControl",
"cloud_layers": "array - Cloud layer objects with base and amount",
"station_name": "string - Full station name",
"wind_direction": "object - Wind direction in degrees",
"text_description": "string - Human-readable weather description",
"relative_humidity": "object - Relative humidity in percent",
"sea_level_pressure": "object - Sea level pressure in Pa",
"barometric_pressure": "object - Barometric pressure in Pa",
"precipitation_last_hour": "object - Precipitation in last hour (value may be null)",
"precipitation_last_3_hours": "object - Precipitation in last 3 hours (value may be null)",
"precipitation_last_6_hours": "object - Precipitation in last 6 hours (value may be null)"
},
"sample": {
"data": {
"dewpoint": {
"value": 21,
"unitCode": "wmoUnit:degC",
"qualityControl": "V"
},
"timestamp": "2026-06-11T00:35:00+00:00",
"wind_gust": {
"value": 42.588,
"unitCode": "wmoUnit:km_h-1",
"qualityControl": "S"
},
"heat_index": {
"value": 36.1,
"unitCode": "wmoUnit:degC",
"qualityControl": "V"
},
"station_id": "KDFW",
"visibility": {
"value": 16093.44,
"unitCode": "wmoUnit:m",
"qualityControl": "C"
},
"wind_chill": {
"value": null,
"unitCode": "wmoUnit:degC",
"qualityControl": "V"
},
"wind_speed": {
"value": 33.336,
"unitCode": "wmoUnit:km_h-1",
"qualityControl": "V"
},
"raw_message": "",
"temperature": {
"value": 33,
"unitCode": "wmoUnit:degC",
"qualityControl": "V"
},
"cloud_layers": [
{
"base": {
"value": 3810,
"unitCode": "wmoUnit:m"
},
"amount": "CLR"
}
],
"station_name": "Dallas/Fort Worth International Airport",
"wind_direction": {
"value": 170,
"unitCode": "wmoUnit:degree_(angle)",
"qualityControl": "V"
},
"text_description": "Clear and Windy",
"relative_humidity": {
"value": 49.4,
"unitCode": "wmoUnit:percent",
"qualityControl": "V"
},
"sea_level_pressure": {
"value": null,
"unitCode": "wmoUnit:Pa",
"qualityControl": "Z"
},
"barometric_pressure": {
"value": 100778.93,
"unitCode": "wmoUnit:Pa",
"qualityControl": "V"
},
"precipitation_last_hour": {},
"precipitation_last_3_hours": {
"value": null,
"unitCode": "wmoUnit:mm",
"qualityControl": "Z"
},
"precipitation_last_6_hours": {}
},
"status": "success"
}
}About the Weather API
Endpoints and Data Coverage
The API is organized around three endpoints, each accepting a station_id parameter such as KATT, KDFW, or KHOU. get_latest_observation returns a single observation object with fields including temperature, dewpoint, wind_speed, wind_gust, visibility, heat_index, wind_chill, pressure, and cloud_layers, plus the raw raw_message METAR string and an ISO 8601 timestamp. Nullable fields like wind_gust, heat_index, and wind_chill are present in the response but may carry a null value depending on conditions.
Paginated Observation History
get_observations returns an array of recent observations for a station ordered from newest to oldest. The limit parameter caps results at 100 per request. When more records exist, the response includes a next_cursor URL to retrieve the next page; when the last page is reached, next_cursor is null. Each entry in the observations array mirrors the field shape from the latest-observation endpoint, including temperature, wind_speed, pressure, humidity, cloud_layers, and raw_message.
Station Metadata
get_station_info returns descriptive metadata for a given station: the human-readable name, coordinates object with latitude and longitude, elevation in meters with a unitCode, an IANA timezone string (e.g., America/Chicago), and a forecast_url pointing to the station's NWS forecast zone. This metadata is useful for mapping stations geographically or associating observations with a named location before making further observation requests.
The Weather API is a managed, monitored endpoint for forecast.weather.gov — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when forecast.weather.gov changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official forecast.weather.gov API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Display real-time temperature, humidity, and wind conditions for a specific NWS station on a weather dashboard.
- Log hourly observation history using
get_observationswith pagination to build a local meteorological dataset. - Parse raw METAR strings from
raw_messagefor aviation pre-flight weather briefing tools. - Plot station locations on a map using
coordinatesandelevationfromget_station_info. - Alert users when
wind_gustorheat_indexvalues exceed defined thresholds. - Associate timezone-aware observation timestamps with local time using the IANA
timezonefield from station metadata. - Combine
wind_speedandwind_chilldata to monitor cold-stress conditions for outdoor work scheduling.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does the NWS have an official developer API?+
What does `get_observations` return and how does pagination work?+
get_observations returns an array of observation objects for a given station_id, ordered most-recent first. Set limit (up to 100) to control how many records come back. If additional records exist, the response includes a next_cursor string containing the URL for the next page. When next_cursor is null, you have reached the end of available observations.Are fields like `wind_gust` and `heat_index` always populated?+
wind_gust, heat_index, and wind_chill are present in every response object but their value may be null. Wind gust is null when no gusts are recorded; heat index and wind chill are null when atmospheric conditions don't meet the thresholds required to calculate them.Does the API return forecast data or only observations?+
forecast_url already returned by get_station_info.