Hourly Electricity API: OMIE Intraday as JSON

Hourly Electricity API: OMIE Intraday as JSON

You need programmatic access to OMIE hourly prices as JSON so you can chart, alert, or settle internal processes. By the end of this article you will request the official hourly curve, parse period/value pairs in EUR/MWh, handle gaps and failures, and ship a reliable integration against Energy API’s electricity/hourly endpoint.

What you will actually get from this endpoint

The hourly electricity endpoint on Energy API returns the day‑ahead curve for one symbol and one official date. For OMIE, request the OMIE_ES_DA contract with a specific date. The response is a live contract structure whose hourly points are published as period/value items in EUR/MWh.

The post title mentions “Intraday,” but the documented hourly endpoint returns the OMIE day‑ahead curve. If you specifically need a different contract family (e.g., retail hours or other intraday constructs), note that PVPC retail hours are served from a different path. This article focuses strictly on the hourly day‑ahead curve described here.

There is no MCP field in this dataset. Consume the hourly curve through the provided period/value fields; do not try to derive MCP from this endpoint.

Endpoint and request parameters

Call the hourly endpoint with three query parameters:

  • symbol: OMIE_ES_DA
  • date: the official hourly date you want
  • api_key: your Energy API key

The docs do not freeze a 24‑hour array; you must handle the live contract’s period/value pairs as published. Some hours can be missing or published differently depending on the market day’s structure. Treat the response as the source of truth for the hours actually available for that date.

Quickstart in 4 steps

  1. Register a developer account to start a 7‑day trial with 50 calls: Register. The Starter plan is $19.99/mo (5,000 calls) after the trial.
  2. Copy your api_key from the dashboard.
  3. GET /api/v1/electricity/hourly with symbol=OMIE_ES_DA and an official date.
  4. Chart the period/value points in EUR/MWh. Do not look for MCP because it is not provided.

Official hourly request

Below is the official request call for an OMIE_ES_DA hourly date. Use it as a template by replacing YOUR_API_KEY with your token.

curl "https://energy-api.com/api/v1/electricity/hourly?symbol=OMIE_ES_DA&date=2026-06-18&api_key=YOUR_API_KEY"

Copy‑paste curl

This curl hits the same documented endpoint and parameters. Replace YOUR_API_KEY with your actual key.

curl -s "https://energy-api.com/api/v1/electricity/hourly?symbol=OMIE_ES_DA&date=2026-06-18&api_key=YOUR_API_KEY"

Python example: fetch, validate, and plot‑ready

This Python snippet calls the same endpoint, normalizes the hours as they come from the API, and prepares a simple list you can hand to your charting layer. It also illustrates how to guard against missing fields.

import os
import sys
import json
import urllib.parse
import urllib.request

API_KEY = os.getenv("ENERGY_API_KEY", "YOUR_API_KEY")
BASE_URL = "https://energy-api.com/api/v1/electricity/hourly"

params = {
    "symbol": "OMIE_ES_DA",
    "date": "2026-06-18",
    "api_key": API_KEY,
}
url = BASE_URL + "?" + urllib.parse.urlencode(params)

try:
    with urllib.request.urlopen(url, timeout=20) as resp:
        body = resp.read().decode("utf-8")
        data = json.loads(body)
except Exception as e:
    print(f"Request failed: {e}", file=sys.stderr)
    sys.exit(1)

# Handle explicit error signaling if present
if isinstance(data, dict) and data.get("success") is False:
    # Treat as API-level error
    print(f"API error: {data}", file=sys.stderr)
    sys.exit(2)

# The live contract returns period/value pairs in EUR/MWh.
# Some hours may be missing; do not assume a frozen 24-item array.
points = []
items = data if isinstance(data, list) else data.get("data") or data.get("items") or []

for item in items:
    period = item.get("period")
    value = item.get("value")
    # Skip incomplete items
    if period is None or value is None:
        continue
    # Collect as-is; do not coerce currency (prices are already in EUR/MWh)
    points.append({"period": period, "value_eur_per_mwh": value})

# Sort if periods are sortable strings or timestamps. If not, keep provider order.
try:
    points.sort(key=lambda x: x["period"])
except Exception:
    pass

print(json.dumps({"symbol": "OMIE_ES_DA", "date": params["date"], "points": points}, ensure_ascii=False, indent=2))

Understanding the response shape

The live hourly contract is delivered as period/value pairs. Values are in EUR/MWh; keep that unit in your pipeline. Do not pass base=USD when you need EUR. If the provider publishes fewer than 24 entries or uses a different hour structure for a given date, your code should consume exactly what is present and avoid padding unless your business logic requires it.

Below is an additional official sample included for reference. It is a different output (a latest daily print) and not the hourly series. Use it only to understand the difference between a daily point and an hourly array. The numeric 82.30 in that sample is a daily print, not an hourly bar.

{
  "base": "MIXED",
  "date": "2026-06-11",
  "rates": {
    "OMIE_ES_DA": 82.30
  }
}

Key takeaways for hourly users:

  • Hourly data is an array of multiple period/value entries.
  • Daily prints (like the 82.30 shown above) represent a single aggregated value for a day and are not interchangeable with the hourly curve.
  • Do not attempt to convert this endpoint’s EUR pricing with a base parameter; consume values as EUR/MWh.

Field‑by‑field: what to read and how to use it

From the hourly response, you will use:

  • period: the published period label or timestamp that identifies the hour bucket.
  • value: the price for that period in EUR/MWh.

If the response includes top‑level metadata (such as status or success flags), check them before consuming the array. When in doubt, consider HTTP codes in addition to any presence of a success flag to decide whether to retry or surface an error.

Dates, time handling, and “official hourly date”

Always request an official hourly date with the date parameter. Do not assume the provider will remap a calendar date to a market date for you. Store the date you requested alongside the points you ingest so you can reconcile charts and backfills unambiguously.

Because the docs do not freeze a 24‑hour array, never hardcode array lengths. When you need a uniform x‑axis in a chart, render only the periods actually received for that date. If you must show a strict 24‑slot axis, insert explicit gaps on your side (e.g., nulls) rather than guessing values.

Caching, retries, and idempotence

  • Cache by (symbol, date) key. The day‑ahead curve for a specific date is stable for most use cases once published, and caching prevents unnecessary repeat calls.
  • For retry logic, gate on both transport errors (timeouts, 5xx) and explicit error signaling in the JSON (e.g., if a success field is present and false). Avoid hammering on 4xx responses; those are usually permanent until you fix the request.
  • Because this call is by symbol and date, it is idempotent for the same inputs. Use safe GET semantics in your integration.

Validation, gaps, and missing values

Be deliberate about data hygiene:

  • Reject or skip items where period or value is missing.
  • Expect that some market days can have fewer or more effective buckets; consume exactly what the API returns.
  • Log and alert on unexpected shapes so you can inspect the payload and adapt quickly.

Currency, units, and charting

  • Unit is EUR/MWh for the hourly values. Keep prices in EUR unless you explicitly convert downstream using your own FX source.
  • Do not pass base=USD to this endpoint when you need EUR. Values are already in EUR/MWh.
  • Label your charts and exports clearly with “EUR/MWh” to avoid downstream confusion.

Production checklist

  • Use symbol=OMIE_ES_DA with a concrete date.
  • Authenticate via api_key query parameter.
  • Parse the live contract’s period/value items; do not assume 24 rows.
  • No MCP is provided; do not attempt to derive it from this payload.
  • Cache per (symbol, date), and set alerts for missing or malformed items.
  • Keep everything in EUR/MWh unless explicitly converted on your side.

Troubleshooting and support

If you encounter unexpected shapes, missing periods, or questions about specific dates, consult the official Documentation. For account issues (e.g., exhausted trial quota), visit the dashboard where you obtained your api_key.

FAQ

Is this “intraday” or “day‑ahead”?
This hourly endpoint delivers the OMIE day‑ahead hourly curve for the requested date. If you need other contract families (e.g., retail hours), those are available via different paths; consult the Documentation.

Which symbol should I use for OMIE hourly day‑ahead?
Use OMIE_ES_DA with an official hourly date.

Why don’t I always get 24 rows?
The docs do not freeze a 24‑hour array. Treat the live contract as authoritative and consume all period/value items actually returned for the date.

Where is MCP?
This dataset does not include MCP. Consume the hourly prices from period/value only.

Why do I see a single number like 82.30 in some examples?
That is a daily print from a different output, not an hourly bar. The hourly endpoint returns multiple period/value pairs for the date.

Ready to ship? Start your 7‑day trial (50 calls) and request OMIE_ES_DA hourly prices today: Register. Then follow the steps above and the official Documentation to integrate the JSON into your charts, alerts, or settlement workflows.

Ready to get started?

Get your API key and start querying energy commodity prices in minutes.

Get API Key