US Weather API

⭐ Beginner's Pick Weather / No Auth Required Beginner HTTPS CORS
Free to Use Varies (check documentation)

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.

Available Data

temperature
weather conditions
humidity
wind speed
forecast data
country name and code

Example Response

JSON Response
{
  "location": "Tokyo",
  "temperature": {
    "current": 22,
    "feels_like": 24,
    "min": 18,
    "max": 26
  },
  "condition": "Partly Cloudy",
  "humidity": 65,
  "wind": {
    "speed": 12,
    "direction": "NE"
  },
  "forecast": [
    {
      "date": "2025-01-16",
      "high": 25,
      "low": 17,
      "condition": "Sunny"
    }
  ]
}

Field Reference

properties.forecast URL to call to retrieve the 7-day forecast for this location
properties.forecastHourly URL to retrieve hourly forecast data for the next 156 hours
properties.gridId NWS office identifier (e.g. TOP) responsible for this location
properties.gridX X coordinate on the NWS grid for this location
properties.gridY Y coordinate on the NWS grid for this location
properties.relativeLocation.properties.city Name of the nearest city to the queried coordinates

Implementation Example

const url = "https://www.weather.gov/documentation/services-web-api";
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.

Common Errors & Troubleshooting

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

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 20/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 54ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Weather
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →