Weather, hydrology and alerts API for Spain. Free with attribution.

Stable JSON access to current weather, 7-day forecast, reservoirs, AEMET alerts, lightning, wildfire risk, snow level and named storms. No API key to start, no signup, no card. The only condition: a visible link back to whataweather.com.

View documentationopenapi.json

Available endpoints

Eight REST resources covering the public data on WhatAWeather. All return JSON, all support CORS and all are server-cached.

GET/api/v1/weather

Current weather + 7-day forecast by city or lat+lon. Open-Meteo proxy, 15 min cache.

Details

GET/api/v1/reservoirs

List of Spanish basins and reservoirs with KPIs (capacity, %, weekly delta).

Details

GET/api/v1/reservoirs/{id}

Individual reservoir or basin record by id or slug.

Details

GET/api/v1/alerts

Active AEMET alerts filtered by ccaa.

Details

GET/api/v1/lightning

Lightning strikes in the last 10 minutes inside a bbox.

Details

GET/api/v1/wildfire-risk

Fire weather risk (FWI/IRI) traffic-lighted by city.

Details

GET/api/v1/storms

Active and historical named storms (Filomena, DANA, ...).

Details

GET/api/v1/snow-level

Current snow line + 24/48h forecast per mountain range.

Details

Quickstart

Four snippets to get started. All calls are GET, no special headers.

curlcurl https://whataweather.com/api/v1/weather?city=madrid
JSconst r = await fetch( 'https://whataweather.com/api/v1/weather?city=madrid' ); const data = await r.json(); console.log(data.current.temperature_2m);
Pythonimport requests r = requests.get( 'https://whataweather.com/api/v1/weather', params={'city': 'madrid'} ) print(r.json()['current']['temperature_2m'])
PHP$json = file_get_contents( 'https://whataweather.com/api/v1/weather?city=madrid' ); $data = json_decode($json, true); echo $data['current']['temperature_2m'];

Who uses it

Local newspapers, mountain blogs, internal civil protection dashboards, university hydrology simulators. If you integrate, drop us a line.

Local media
Mountain federations
Universities
Control rooms

Summary terms of use

About the WhatAWeather public API

The WhatAWeather public API is a set of REST endpoints designed specifically for developers, news outlets and public services that need Spanish weather and hydrology data fast, reliably and free. Unlike commercial APIs, we do not require a key to start, do not limit use cases (including commercial ones), and we keep latency low thanks to an in-memory caching layer that refreshes data every 15 to 60 minutes depending on the upstream source.

The design is minimal yet complete. Each endpoint returns a stable JSON object with clearly typed fields (numbers, strings, ISO 8601 dates) and a common metadata block: when the data was generated, how long it will live in cache and what its original source is. The source may be a real provider (Open-Meteo for weather, MITECO for reservoirs, AEMET for alerts) or, for endpoints where no provider has a license that allows redistribution yet, a placeholder explicitly marked as such. The meta.source: "placeholder" mark lets you filter or label them in your UI.

URLs are readable and predictable. /api/v1/weather?city=madrid returns weather for Madrid; /api/v1/reservoirs/alcantara returns the Alcantara reservoir record; /api/v1/alerts?ccaa=valencia returns active AEMET alerts in the Valencian Community. We support queries by city name or lat/lon pair indistinctly, which simplifies integration with interactive maps and other geographic apps. CORS is open to *: you can call the API directly from the browser without a proxy.

If you prefer, we have also published an OpenAPI 3.0 specification at /api/openapi.json with all the schemas, parameters and examples. Generate clients in any language with openapi-generator, import it into Postman or Insomnia, or use Swagger UI to explore the endpoints visually. To visualise the output without writing code, our embeddable widgets consume exactly this API.