Spain Electricity Prices & Demand API

Spanish electricity market series from Red Electrica: PVPC and spot prices, national demand and the generation mix by technology, as one typed row per series and time step.

$0.50 per 1,000 records

You pay only for the records you get. Zero records cost zero. 10,000 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.

Try it
Ready-made, maintained by usRecords, 6 fieldsv1.0

Data from apidatos.ree.es/en/datos/mercados/precios-mercados-tiempo-real

Get this data

Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.

Try it

Data typeoptional
Which series to read: prices, demand or generation_mix.
Startoptional
From this time, YYYY-MM-DD or YYYY-MM-DDTHH:MM (Spanish time). Default: 7 days ago.
Example: 2026-12-04T00:00
Endoptional
Until this time, same format. Default: now.
Example: 2026-12-04T23:59
Time truncoptional
Step: hour (prices only), day or month.

Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 10,000 records of this API, no card. Create a free key

For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
Endpoint
POSThttps://pullrow.dev/v1/apis/spain-electricity-market/run
  • Small runs answer in the same request; longer ones answer 202 with a run to poll.
  • fields returns only the fields you name. The examples send the ones picked on this page.
  • Idempotency-Key is optional. A retry with it is never charged twice.
  • You pay for records returned. Zero records cost zero.

Every run option, explained

Calling it needs a key
10,000 free records of this API to start. No card.
curl
curl -X POST "https://pullrow.dev/v1/apis/spain-electricity-market/run" \
  -H "Authorization: Bearer $PULLROW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"data_type":"prices"},"max_items":50}'

Inputs

Send them as input in the request body. Leave one out to use its default.

data_typetext
Which series to read: prices, demand or generation_mix.
default: pricesexample: pricesone of: prices, demand, generation_mix
starttext
From this time, YYYY-MM-DD or YYYY-MM-DDTHH:MM (Spanish time). Default: 7 days ago.
example: 2026-12-04T00:00
endtext
Until this time, same format. Default: now.
example: 2026-12-04T23:59
time_trunctext
Step: hour (prices only), day or month.
default: dayexample: hourone of: hour, day, month

What's in each record

6 fields.

Basics

  • Series

    Series name, such as PVPC, Spot market price, Demand, Wind or Nuclear.

    Example PVPC

  • Value

    Value in the unit given in unit.

    Example 237.5

  • Percentage

    Share of the total for that step, 0 to 1 (for the generation mix: share of all generation).

    Example 0.46798

  • Unit

    EUR/MWh for prices, MWh for demand and generation.

    Example EUR/MWh

  • Place

    Area: peninsular (prices) or national (demand and generation).

    Example peninsular

Dates

  • Datetime

    Start of the time step (UTC).

    Example Dec 3, 2026

Technical detailsField names and types for developers

Field names and types

The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.

Field nameTypeShown on this page asFilled
seriestextSeries3 of 3
datetimedate and timeDatetime3 of 3
valuenumberValue3 of 3
percentagenumberPercentage3 of 3
unittextUnit3 of 3
geotextPlace3 of 3

How it reads the site

Runs on a reader we built and maintain by hand for this site.

Sample records

Sample records
RecordSeriesValuePercentageUnitPlaceDatetime
1PVPC237.50.46798EUR/MWhpeninsularDec 3, 2026
2PVPC215.230.466644EUR/MWhpeninsularDec 4, 2026
3PVPC194.430.459287EUR/MWhpeninsularDec 4, 2026

Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.

Reliability

Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.

Incidents and repairs

How it is kept working What a repair can't do

A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.

  • You pay only for records returned. A run that returns none costs nothing.
Known limits
  • Prices (PVPC and spot, EUR/MWh) can be read by hour, day or month; demand and the generation mix (MWh) by day or month only, because the source refuses hourly steps for them.
  • Prices cover the Spanish mainland (peninsular) market; demand and generation are national totals.
  • The source publishes next-day prices in the afternoon and revises recent demand and generation figures; the latest days can change.
  • Source reuse is free with credit to Red Electrica (REData); no request limit is published, so requests are spaced out. A single request returns a whole period, so large periods give many rows.

Version history

A run uses the live version unless the request names another one with version.