US Weather API

Beginner's Pick Weather / No Auth Required Beginner HTTPS CORS
Free to Use
78 B
Measured Score 0 50 100 Speed 27/30 Consistency 8/20 Security 20/20 Browser access 15/15 Transparency 8/15 TESTED 2026-08-10

Overview

The US Weather API is the official National Weather Service (NWS) REST API provided by the US government, offering free and unlimited access to forecasts, alerts, and observation data for the United States. It requires no API key, making it the easiest way to add weather data to any US-focused application. Beginners can retrieve a 7-day forecast for any US location using just the geographic coordinates.

Beginner Tip

No API key or registration is needed. Use a two-step process: first get the grid point from coordinates, then fetch the forecast from the returned forecast URL.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://api.weather.gov/points/39.7456,-97.0892
Result
HTTP 200 · application/geo+json · 3,928 bytes · compressed
Response time
39 ms (median of 3) · fastest 28 ms
Transport
TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Let's Encrypt
Browser CORS
Allowed — Access-Control-Allow-Origin: *
Served by
nginx/1.28.3
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
@context array [1 item]
id string (url) https://api.weather.gov/points/39.7456,-97.0892
type string Feature
geometry object {2 fields}
properties object {15 fields}

Captured Response

Captured from a real request to https://api.weather.gov/points/39.7456,-97.0892 on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "@context": [
    "https://geojson.org/geojson-ld/geojson-context.jsonld"
  ],
  "id": "https://api.weather.gov/points/39.7456,-97.0892",
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [
      -97.0892
    ]
  },
  "properties": {
    "@id": "https://api.weather.gov/points/39.7456,-97.0892",
    "@type": "wx:Point",
    "cwa": "TOP",
    "type": "land",
    "forecastOffice": "https://api.weather.gov/offices/TOP",
    "gridId": "TOP",
    "gridX": 32,
    "gridY": 81,
    "forecast": "https://api.weather.gov/gridpoints/TOP/32,81/forecast",
    "forecastHourly": "https://api.weather.gov/gridpoints/TOP/32,81/forecast/hourly",
    "forecastGridData": "https://api.weather.gov/gridpoints/TOP/32,81",
    "observationStations": "https://api.weather.gov/gridpoints/TOP/32,81/stations",
    "relativeLocation": {
      "type": "Feature",
      "geometry": {
        "…": "(2 more fields)"
      },
      "properties": {
        "…": "(4 more fields)"
      }
    },
    "forecastZone": "https://api.weather.gov/zones/forecast/KSZ009",
    "…": "(6 more fields)"
  }
}

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://api.weather.gov/points/39.7456,-97.0892";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 404 Requesting a path that does not exist application/problem+json
{
  "correlationId": "f46f837",
  "title": "Not Found",
  "type": "https://api.weather.gov/problems/NotFound",
  "status": 404,
  "detail": "'/points/39.7456,-97.0892/apisscore-nonexistent-path' is not a valid resource path",
  "instance": "https://api.weather.gov/requests/f46f837"
}

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

404 Not Found for /points endpoint Coordinates are outside the United States or in an ocean area
This API only covers the 50 US states; use a different API for international or ocean locations
Unexpected 500 error NWS server temporarily unavailable for that grid point
Implement retry logic with a short delay; NWS services occasionally have brief outages by region
User-Agent header warning in response Missing or generic User-Agent header
NWS requires a descriptive User-Agent like "MyWeatherApp/1.0 [email protected]" to identify your application

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 27/30
Consistency 8/20
Security 20/20
Browser access 15/15
Transparency 8/15
Endpoint Response Time 39ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Weather
Difficulty Beginner
Endpoint last called: 2026-08-10

Related Tags

Similar APIs

View All →