Microproduct data guidebeginner

National Weather Service API

Current U.S. forecasts, observations, and official weather alerts for building local planning tools and operational warning products.

At a glance

Difficulty
Beginner — comfortable for a first prototype
Size
Small · ≤0.1 GB
Formats
GeoJSON, JSON-LD, CAP XML
Access
API
API key
Not required
Provider
National Weather Service
Updates
Continuous
Data terms
U.S. Public Domain / NWS usage policy

From source to product signal

Test a product idea in four steps

The National Weather Service API provides official U.S. forecasts, observations, watches, warnings, and advisories. Start with one coordinate and the hourly forecast returned for its grid point. Forecasts can change, and an application must not present stale or transformed data as an active official warning.

1

Check the setup

  • Python 3.10 or newer
  • A notebook environment such as Jupyter or Google Colab
  • A descriptive application URL or email address for the required User-Agent header
2

Access the data

  1. 1.Read the API documentation and choose one U.S. coordinate.
  2. 2.Send the coordinate to the points endpoint to discover its current hourly forecast URL.
  3. 3.Request the forecast with a descriptive User-Agent and save its update timestamp.
Open official source
3

Run the Python example

Install the packages, then run the notebook cell.

python -m pip install pandas requests

import pandas as pd
import requests

headers = {
    "User-Agent": "TrilemmaDataGuide/1.0 (https://data.trilemma.foundation)"
}
point = requests.get(
    "https://api.weather.gov/points/40.7128,-74.0060",
    headers=headers,
    timeout=30,
)
point.raise_for_status()
forecast_url = point.json()["properties"]["forecastHourly"]
forecast = requests.get(forecast_url, headers=headers, timeout=30)
forecast.raise_for_status()
hours = pd.json_normalize(forecast.json()["properties"]["periods"])
print(hours[["startTime", "temperature", "windSpeed", "shortForecast"]].head())
4

Test a useful signal

Flag risky hours for an outdoor plan

Test whether the hourly forecast can provide a useful weather-risk signal for one location.

  1. 01Convert forecast start times to timezone-aware timestamps and select the next 24 hours.
  2. 02Flag periods containing rain, storms, snow, or high winds in the forecast fields.
  3. 03Explain when the data was issued, how often the product must refresh it, and why users should still follow official alerts.

Dataset details

National Weather Service is a government source. Last verified 2026-08-11. Temporal coverage: current forecasts, observations, and recent alerts.

Domains

WeatherEmergency ManagementTransportation

Data types

GeospatialTime SeriesEvent Data

Tasks

AlertingForecastingOperational Planning

Geography

United States

Formats

GeoJSONJSON-LDCAP XML

Provider

National Weather Service

Data terms

U.S. Public Domain / NWS usage policy