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
Current U.S. forecasts, observations, and official weather alerts for building local planning tools and operational warning products.
From source to product signal
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.
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())Test a useful signal
Test whether the hourly forecast can provide a useful weather-risk signal for one location.
National Weather Service is a government source. Last verified 2026-08-11. Temporal coverage: current forecasts, observations, and recent alerts.