Skip to main content

Prices

Retrieve the latest price prediction for a region and market. This endpoint always returns the latest prediction available and the values of the response will change depending on the time of the day on which the request is made. The data can be returned as JSON (default) or as a CSV file.

Base path: /api/v0/prices

Requires Bearer API key and the correct permissions.

Request​

The endpoint only accepts the method GET and the URL path must include the region and market identifiers.

GET https://api.ravenwits.com/api/v0/prices/<region>/<market>

URL parameters​

NameTypeRequiredDescription
regionstringYesRegion identifier (e.g. spain)
marketstringYesMarket identifier (e.g. md_pdbc_spain)

Supported region/market combinations​

regionmarket
spainmd_pdbc_spain
spainmid_pibc01_spain
spainmid_pibc02_spain
spainmid_pibc03_spain
spainesios_2197
spainesios_10250
canariasphven_canarias

Query parameters​

The supported parameters are specified on the table below. Any other parameter specified in the request that does not appear in the documentation will make the request fail with a 400 error.

NameTypeRequiredDescription
formatstringNoResponse format: json (default) or csv

Content negotiation​

The response format can be selected either via the format query parameter or the Accept header:

Accept header / format paramFormat returned
application/json / json (default)JSON array of objects
text/csv / csvCSV file download

Request (JSON)​

curl --request GET \
--url 'https://api.ravenwits.com/api/v0/prices/spain/md_pdbc_spain' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your-api-key}'

Request (CSV download)​

curl --request GET \
--url 'https://api.ravenwits.com/api/v0/prices/spain/md_pdbc_spain?format=csv' \
--header 'Authorization: Bearer {your-api-key}' \
--output spain_md_pdbc_spain.csv

Response​

Every response includes the Last-Modified header, which indicates when the latest prediction was generated. This header follows RFC 9110 format eg. Last-Modified: Fri, 07 Aug 2026 13:10:00 GMT. The value of the header Last-Modified will change depending on the region and market requested because the predictions for all combinations are not generated at the same time.

The response has two fields, datetime and price. datetime has the format YYYY-MM-DD HH:MM, is in the timezone of the market requested and represents the start of the 15-minute period. For example, for the Spanish market, the timezone is Europe/Madrid (UTC+2 in summer and UTC+1 in winter). price is a decimal number with three digits after the decimal point and the unit is EUR/MWh.

Daylight Savings Time (DST) Handling​

On days when Daylight Saving Time (DST) starts or ends, the local day contains either 23 or 25 hours instead of the usual 24. Consequently, files containing data for these dates will contain one fewer or one additional hourly interval, respectively. Specifically, on the 25-hour day, the local-time interval 02:00–03:00 occurs twice and therefore appears twice in the data. On the 23-hour day, this interval does not occur and is therefore missing from the data.

200 OK — JSON​

Returns an array of objects with two fields per row: datetime and price.

[
{"datetime": "2026-08-07 00:15", "price": "165.824"},
{"datetime": "2026-08-07 00:30", "price": "164.077"},
{"datetime": "2026-08-07 00:45", "price": "162.312"}
]

200 OK — CSV​

Returns a semicolon-delimited CSV file.

datetime;price
2026-08-07 00:15;165.824
2026-08-07 00:30;164.077
2026-08-07 00:45;162.312

Errors​

400 Bad Request​

Bad request due to missing or invalid parameters.

{"detail": "Unknown query parameters: ..."}

401 Unauthorized​

Missing or invalid Bearer API key.

{"detail": "Authentication credentials were not provided."}

403 Forbidden​

Valid API key but the account does not have the required permissions.

{"detail": "You do not have permission to perform this action."}

406 Not Acceptable​

The Accept header does not match any of the supported formats.

{"detail": "Could not satisfy the request Accept header."}