The US National Weather Service API at https://api.weather.gov covers US locations only. Forecasts take two steps: look up a point to get its forecast office and grid, then fetch the grid's forecast.
None. NWS asks clients to send a User-Agent identifying the app and a contact; browsers send their own automatically.
Full reference: https://www.weather.gov/documentation/services-web-api
The forecast URL under properties is what to fetch next.
curl https://api.weather.gov/points/40.7128,-74.0060
{
"@context": [
"https://geojson.org/geojson-ld/geojson-context.jsonld",
{
"@version": "1.1",
"wx": "https://api.weather.gov/ontology#",
"s": "https://schema.org/",
"geo": "http://www.opengis.net/ont/geosparql#",
"unit": "http://codes.wmo.int/common/unit/",
"@vocab": "https://api.weather.gov/ontology#",
"geometry": {
"@id": "s:GeoCoordinates",
"@type": "geo:wktLiteral"
},
"city": "s:addressLocality",
"state": "s:addressRegion",
"distance": {
"@id": "s:Distance",
"@type": "s:QuantitativeValue"
},
"bearing": {
"@type": "s:QuantitativeValue"
},
"value": {
"@id": "s:value"
},
"unitCode": {
"@id": "s:unitCode",
"@type": "@id"
},
"forecastOffice": {
"@type": "@id"
},
"forecastGridData": {
"@type": "@id"
}
}
],
"id": "https://api.weather.gov/points/40.7128,-74.006",
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-74.006,
40.7128
]
},
"properties": {
"@id": "https://api.weather.gov/points/40.7128,-74.006",
"@type": "wx:Point",
"cwa": "OKX",
"type": "land",
"forecastOffice": "https://api.weather.gov/offices/OKX",
"gridId": "OKX",
"gridX": 33,
"gridY": 42,
"forecast": "https://api.weather.gov/gridpoints/OKX/33,42/forecast",
"forecastHourly": "https://api.weather.gov/gridpoints/OKX/33,42/forecast/hourly",
"forecastGridData": "https://api.weather.gov/gridpoints/OKX/33,42",
"observationStations": "https://api.weather.gov/gridpoints/OKX/33,42/stations",
"relativeLocation": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-73.9386769,
40.6627117
]
},
"properties": {
"city": "New York",
"state": "NY",
"distance": {
"unitCode": "wmoUnit:m",
"value": 0
},
"bearing": {
"unitCode": "wmoUnit:degree_(angle)",
"value": 0
}
}
},
"forecastZone": "https://api.weather.gov/zones/forecast/NYZ072",
"county": "https://api.weather.gov/zones/county/NYC061"
}
}
The office and grid numbers come from the points call (this is New York City).
curl https://api.weather.gov/gridpoints/OKX/33,42/forecast
{
"@context": [
"https://geojson.org/geojson-ld/geojson-context.jsonld",
{
"@version": "1.1",
"wx": "https://api.weather.gov/ontology#",
"geo": "http://www.opengis.net/ont/geosparql#",
"unit": "http://codes.wmo.int/common/unit/",
"@vocab": "https://api.weather.gov/ontology#"
}
],
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-74.0009,
40.702
],
[
-73.9965,
40.7237
]
]
]
},
"properties": {
"units": "us",
"forecastGenerator": "BaselineForecastGenerator",
"generatedAt": "2026-09-23T21:16:37+00:00",
"updateTime": "2026-09-23T20:31:37+00:00",
"validTimes": "2026-09-23T14:00:00+00:00/P7DT11H",
"elevation": {
"unitCode": "wmoUnit:m",
"value": 2.1336
},
"periods": [
{
"number": 1,
"name": "This Afternoon",
"startTime": "2026-09-23T17:00:00-04:00",
"endTime": "2026-09-23T18:00:00-04:00",
"isDaytime": true,
"temperature": 68,
"temperatureUnit": "F",
"temperatureTrend": null,
"probabilityOfPrecipitation": {
"unitCode": "wmoUnit:percent",
"value": 0
},
"windSpeed": "18 mph",
"windDirection": "NE",
"icon": "https://api.weather.gov/icons/land/day/sct?size=medium",
"shortForecast": "Mostly Sunny",
"detailedForecast": "Mostly sunny. High near 68, with temperatures falling to around 65 in the afternoon. Northeast wind around 18 mph."
},
{
"number": 2,
"name": "Tonight",
"startTime": "2026-09-23T18:00:00-04:00",
"endTime": "2026-09-24T06:00:00-04:00",
"isDaytime": false,
"temperature": 56,
"temperatureUnit": "F",
"temperatureTrend": null,
"probabilityOfPrecipitation": {
"unitCode": "wmoUnit:percent",
"value": 0
},
"windSpeed": "20 mph",
"windDirection": "NE",
"icon": "https://api.weather.gov/icons/land/night/sct?size=medium",
"shortForecast": "Partly Cloudy",
"detailedForecast": "Partly cloudy, with a low around 56. Northeast wind around 20 mph."
}
]
}
}
curl "https://api.weather.gov/alerts/active?area=CA"
{
"@context": [
"https://geojson.org/geojson-ld/geojson-context.jsonld",
{
"@version": "1.1",
"wx": "https://api.weather.gov/ontology#",
"@vocab": "https://api.weather.gov/ontology#"
}
],
"type": "FeatureCollection",
"features": [
{
"id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.81b35a4471393e2181e3c66ed3f9901ad3332af0.001.1",
"type": "Feature",
"geometry": null,
"properties": {
"@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.81b35a4471393e2181e3c66ed3f9901ad3332af0.001.1",
"@type": "wx:Alert",
"id": "urn:oid:2.49.0.1.840.0.81b35a4471393e2181e3c66ed3f9901ad3332af0.001.1",
"areaDesc": "Modoc County Except for the Surprise Valley",
"geocode": {},
"affectedZones": [
"https://api.weather.gov/zones/fire/CAZ285"
],
"references": [],
"sent": "2026-09-23T10:43:00-07:00",
"effective": "2026-09-23T10:43:00-07:00",
"onset": "2026-09-24T14:00:00-07:00",
"expires": "2026-09-23T22:45:00-07:00",
"ends": "2026-09-24T20:00:00-07:00",
"status": "Actual",
"messageType": "Alert",
"category": "Met"
}
}
],
"title": "Current watches, warnings, and advisories for California",
"updated": "2026-09-23T21:15:17+00:00"
}