Weather API
Multi-Provider
Current + Forecast
Severe Weather Alerts

Weather data. Normalized.

Current conditions and forecasts merged from US NWS and MET Norway into one consistent payload, with alerts, per-provider diagnostics, and predictable fallback behavior.

2+ · weather providers14 · max forecast days24 · hourly entries°C / °F · unit control

Check conditions anywhere.

This calls the live Weather API. Pick a city, switch between current conditions and the forecast, and choose your units.

Request builder
Coordinates in, normalized weather out.
GET /weather/forecast

lat 40.7128, lon -74.006. Any coordinates work in production.

5 days

Demo capped at 7 days. The API supports up to 14.

Provider merge
NWS and MET Norway responses are merged with deterministic precedence. The sources array in every response shows exactly which providers answered.
Output preview
Live response from the API, plus the exact request to reproduce it.

Loading live conditions...

Why Weather API

One schema for every forecast.

Multi-provider merge

US NWS and MET Norway data combined with deterministic precedence, plus optional OpenWeather enrichment. One payload, no provider-specific parsing.

Current + forecast

Current conditions, up to 24 hourly entries, and daily highs and lows for up to 14 days from a single coordinate pair.

Severe weather alerts

Active alerts with title, severity, start and end times, and full description text, sourced per provider.

Unit control

Request celsius, fahrenheit, or auto to match the region. Every temperature field is labeled with its resolved unit.

Degradation signals

A degraded flag and per-provider sources array tell you when data is partial, cached, or a provider failed, so fallbacks are predictable.

Rich condition detail

Humidity, dew point, pressure, wind gusts, cloud cover, UV index, precipitation type and probability, and visibility when available.

/api/v1/weather

Endpoints, at a glance.

Two GET endpoints: /current for conditions right now, /forecast for hourly and daily periods. Same normalized schema for both.
GET/api/v1/weather/current

Current conditions

Requires lat and lon. Returns normalized current conditions with humidity, wind, pressure, UV index, and precipitation detail.

PRIMARY
GET/api/v1/weather/forecast

Forecast

Current conditions plus up to 24 hourly entries and daily periods for up to 14 days, controlled by forecastDays.

GET/health

Service health

Status, service name, version, timestamp, and correlationId.

GET/metrics

Prometheus metrics

Request counts and provider latency metrics in Prometheus exposition format.

ParameterTypeRequiredDescription
latnumberyesLatitude in decimal degrees, from -90 to 90.
lonnumberyesLongitude in decimal degrees, from -180 to 180.
unitsstringnoTemperature unit preference: "auto" (by region), "celsius", or "fahrenheit".
forecastDaysintegernoForecast period limit from 1 to 14 days. Applies to /forecast only.

Error reference

Failures you can plan for.

Error responses carry a machine-readable reason, a correlationId, and per-provider diagnostics in sources.

400Validation Error

Missing or out-of-range lat or lon, or an invalid units or forecastDays value. The details array lists each failing field.

401Authentication Error

Missing or invalid gateway API credentials. Send x-api-key or api_key with every request.

404Not Found

Unknown route. Valid paths are /current and /forecast under /api/v1/weather.

429Rate Limit

More than 120 requests in a 15-minute window. Back off and retry with the provided guidance.

503Providers Unavailable

All upstream weather providers failed. The sources array shows per-provider errors; reason is providers-unavailable.

500Internal Error

Unexpected runtime failure. Include the correlationId when reporting the issue.

Example error response

{
  "success": false,
  "error": "Weather data unavailable from all providers",
  "reason": "providers-unavailable",
  "sources": [
    { "provider": "nws", "available": false, "error": "NWS request failed" },
    { "provider": "metno", "available": false, "error": "MET Norway request failed" }
  ],
  "correlationId": "req_err123"
}

FAQ

API questions developers ask first.

Where does the weather data come from?

Responses merge the US National Weather Service and MET Norway with deterministic precedence, plus optional OpenWeather enrichment when configured. The sources array in every response shows which providers answered and how long each took.

What happens when a weather provider is down?

The API degrades predictably: available providers fill the payload, the degraded flag is set when data is partial, and per-provider errors appear in sources. If every provider fails you get a 503 with reason providers-unavailable.

How far out does the forecast go?

GET /forecast returns daily periods for up to 14 days (set forecastDays from 1 to 14) plus up to 24 hourly entries for the near term.

Does the API support both Celsius and Fahrenheit?

Yes. Set units to celsius, fahrenheit, or auto to match the region of the coordinates. Every temperature field is accompanied by its resolved temperatureUnit.

How do I authenticate requests?

Send your Datpaq API key as an x-api-key header or an api_key query parameter. Keys are created in the Datpaq dashboard and a free tier is included.

Add weather to your app in one request.

Send coordinates, get normalized current conditions, forecasts, and alerts. Provider merging, unit handling, and fallback logic are already done for you.