Simple ESIOS API

A simple API to retrieve data from the Spanish electricity grid.

Simple ESIOS API

A lean API on top of Spain’s electricity grid data.

API example · Source

Spain’s grid operator (REE) publishes electricity data through ESIOS, a powerful but famously cumbersome API — bloated responses, patchy docs, and units nobody wants to deal with at 2am. I built a bridge API that sits in front of it and hands back exactly what you need, in the shape you’d actually want it.

What it does

  • Strips ESIOS’s verbose, over-fielded responses down to clean, purpose-built JSON
  • Current endpoint returns hourly PVPC electricity prices for any given date, converted to sane units (€/kWh) and ISO datetimes — no more parsing Spanish decimal strings by hand
  • Built to grow: each ESIOS use case lives in its own endpoint, so new ones can be added without touching the rest

How it’s built

AWS Lambda behind API Gateway, written in Python. A request hits API Gateway, the Lambda calls ESIOS, and the response gets cleaned up — decimal and unit conversion, dead fields stripped — before going back to the caller as plain JSON.

  • Per-endpoint structure — each ESIOS use case is its own directory with its own Lambda function and README, so the API can grow one endpoint at a time
  • Versioned — changes are tracked in a changelog and released under semver as the API evolves

Try it yourself — GET /prices?date=2026-01-26 against the live endpoint and see the clean response come back.