Calibrating Real-Time Flexibility Markets: Using Energy API to Price, Aggregate, and Certify Distributed Energy Resource Flex Offers

Calibrating Real-Time Flexibility Markets: Using Energy API to Price, Aggregate, and Certify Distributed Energy Resource Flex Offers

Real-time flexibility markets promise to turn distributed energy resources (DERs) into reliable grid services. But pricing, aggregating, and certifying DER flex offers in production is hard when your inputs are splintered across day-ahead auctions, intraday curves, gas/oil reference prices, carbon prices, and grid carbon intensity published by different operators, on different schedules, and in incompatible formats. If you have to reconcile OMIE for Spain, ENTSO-E for central EU, EIA/FRED for US fuel references, and ESIOS for retail reference signals, your delivery risk balloons before you schedule a single kilowatt-hour.

In this post, we’ll show how to calibrate a real-time flexibility market using a single, unified data plane: Energy API. You’ll learn how to pull coherent electricity price curves for bidding windows, reference gas and oil prices for hedging cost-of-energy estimates, carbon allowance prices for environmental accounting, and grid carbon intensity for emissions-aware dispatch. We’ll go deep on pricing, aggregation, and certification primitives that help align DER flex offers to market reality—so you can move from prototype to production quickly, with confidence in your market data.

The approach is practical and developer-first: get the minimum data needed to compute a locational or zonal flex strike price, aggregate device-level bids into portfolio positions, and attach transparent, auditable proof of input prices and carbon context. If you’re building flexibility orchestration for batteries, EV fleets, heat pumps, industrial demand response, or VPPs, this guide will save you weeks of scraping, ETL, and schema debugging—while improving the traceability your market and compliance teams demand.

Why Energy API

Flexibility markets are a data problem before they are a dispatch problem. You need electricity prices at the right cadence (hourly or 15-min), upstream commodity references for hedging assumptions, and carbon intensity to quantify impact. Doing that with multiple providers means reconciling naming conventions, currencies, time zones, calendars, and downtime windows. Energy API solves this with a single normalized REST surface that covers electricity, gas, oil, coal, carbon, and grid carbon intensity—using a common JSON schema and consistent error behavior.

  • One normalized interface replaces OMIE, ENTSO-E, EIA/FRED, and ESIOS. Spend time engineering flex strategies, not ETL pipelines. A single JSON schema means your downstream code (pricing modules, risk, certification exports) stays the same whether you’re pulling OMIE_ES_DA, EPEX_DE_DA, TTF_GAS, BRENT_CRUDE, or EUA_CO2.
  • Intraday electricity curves where available. Bidding to an hourly or quarter-hourly product? Use /electricity/hourly to fetch the full curve for a symbol and date, then align DER flex offers to market periods—no custom screen-scraping or CSV munging.
  • Cross-commodity joins in one call. Price discovery for DER fleets often blends electricity with gas, oil, and carbon references (e.g., spark and dark spreads, or emissions shadow pricing). Query multiple commodities in the same /latest or /timeseries call—no extra integration work.
  • Deterministic day-ahead forecasts for auction-sourced symbols. Use /forecast to fetch the next published day-ahead price once the operator posts it. This is not a probabilistic model; it’s a reliable, auditable lookup of official auction results.

The payoff: faster iteration, fewer data discrepancies, and clearer audit trails. Developers ship features in hours instead of weeks, data engineers get stable schemas and versionable pipelines, and product teams gain consistent market context across countries and assets.

Quick Start

Base URL: https://energy-api.com/api/v1

All requests share a consistent response envelope with success flags and typed values. Let’s verify connectivity and pull live cross-commodity references—oil, gas, and carbon—in one request. That single call is already enough to calibrate hedge assumptions and emissions cost adders in many flex-pricing models.

Example: fetch the most recent values for Brent crude, TTF gas, and EU ETS allowances using /latest.

curl -G https://energy-api.com/api/v1/latest \
--data-urlencode "symbols=BRENT_CRUDE,TTF_GAS,EUA_CO2" \
--data-urlencode "api_key=YOUR_API_KEY"

Sample response:

{
"success": true,
"date": "2026-06-11",
"base": "MIXED",
"rates": {
"BRENT_CRUDE": 74.82,
"TTF_GAS": 38.15,
"EUA_CO2": 67.40
},
"dates": {
"BRENT_CRUDE": "2026-06-11",
"TTF_GAS": "2026-06-11",
"EUA_CO2": "2026-06-11"
},
"currencies": {
"BRENT_CRUDE": "USD",
"TTF_GAS": "EUR",
"EUA_CO2": "EUR"
}
}

Key fields:

  • rates: The latest numeric value per symbol. Use this directly in cost-of-energy or shadow-price calculations.
  • dates: Publishing date per symbol. Keep these for audit logs and certification exports of your flex settlements.
  • currencies: Currency per symbol. Convert upstream if needed; or constrain currency at request time using base where supported.

With one payload you now have coherent fuel and carbon references for pricing DER flex commitments, hedging exposure, or labeling bids with an emissions-adjusted price index.

Core Endpoints for Flexibility Pricing, Aggregation, and Certification

This section focuses on endpoints you’ll likely use when building flex markets and DER orchestration: discovery, latest, timeseries, intraday curves, carbon intensity, deterministic day-ahead forecasts, fluctuation analytics, and cost estimation. Each example shows concrete calls and response interpretations that map to common pricing and certification workflows.

1) Discover symbols: GET /symbols

Before you wire up your pricing engine, list the available symbols and pick the references your market requires. For example, if you’re operating in Spain and Germany, you might use OMIE_ES_DA and EPEX_DE_DA for day-ahead pricing, plus PVPC_ES_2TD for retail reference in Spanish demand response programs.

curl -G https://energy-api.com/api/v1/symbols \
--data-urlencode "category=electricity" \
--data-urlencode "api_key=YOUR_API_KEY"

Sample response (truncated for brevity):

{
"success": true,
"count": 5,
"symbols": [
{
"symbol": "OMIE_ES_DA",
"name": "OMIE Spain Day-Ahead",
"category": "electricity",
"country_code": "ES",
"currency_code": "EUR",
"frequency": "daily",
"description": "OMIE day-ahead price for Spain."
},
{
"symbol": "EPEX_DE_DA",
"name": "EPEX Germany Day-Ahead",
"category": "electricity",
"country_code": "DE",
"currency_code": "EUR",
"frequency": "daily",
"description": "EPEX DE day-ahead auction result."
},
{
"symbol": "PVPC_ES_2TD",
"name": "Spain PVPC 2.0TD Retail Reference",
"category": "electricity",
"country_code": "ES",
"currency_code": "EUR",
"frequency": "hourly",
"description": "PVPC hourly retail reference for Spain."
},
{
"symbol": "AEMO_NSW1",
"name": "AEMO New South Wales",
"category": "electricity",
"country_code": "AU",
"currency_code": "AUD",
"frequency": "5-min/hourly",
"description": "AEMO NSW prices aggregated to hourly or interval-based."
},
{
"symbol": "CARBON_INT_DE",
"name": "Germany Grid Carbon Intensity",
"category": "carbon_intensity",
"country_code": "DE",
"currency_code": "N/A",
"frequency": "hourly",
"description": "Grid carbon intensity in gCO2eq/kWh."
}
]
}

Practical tips:

  • Use category and provider filters to keep your symbol list small and controlled for a given market.
  • Persist the symbol metadata in your configuration repository. Keep the description and frequency nearby to inform UI labels and aggregation windows.
  • Couple country_code with your device registry so you can route each DER to relevant pricing symbols automatically.

2) Cross-commodity latest values: GET /latest

Pricing flex bids often needs more than electricity. You might include gas to back out a spark spread, EUA_CO2 to apply an emissions shadow price, or coal/oil as benchmarking anchors. The /latest endpoint returns a coherent cross-commodity snapshot and publishing dates, so you can embed this in every pricing and certification artifact.

curl -G https://energy-api.com/api/v1/latest \
--data-urlencode "symbols=OMIE_ES_DA,EPEX_DE_DA,TTF_GAS,EUA_CO2,BRENT_CRUDE" \
--data-urlencode "api_key=YOUR_API_KEY"

Interpreting the response:

  • Use OMIE_ES_DA and EPEX_DE_DA to anchor flex strike prices per market.
  • Use TTF_GAS when your portfolio includes gas-fired generators or when you derive implied costs for thermal baselines.
  • Use EUA_CO2 to add a CO2 cost component for emissions-aware dispatch and certification (e.g., show a CO2-adjusted LMP-like reference).
  • Use BRENT_CRUDE as a macro-market signal or to align with client hedging models.

3) Historical timeseries for backtests: GET /timeseries

Backtesting a flex strategy requires historical curves. With /timeseries, you can fetch daily or hourly series for the symbols that matter, then compute revenue attribution, hit-rate of activation windows, and time-weighted emissions. The dates are keyed by symbol, and the frequencies field tells you how to resample or align data for your backtests.

curl -G https://energy-api.com/api/v1/timeseries \
--data-urlencode "start=2025-01-01" \
--data-urlencode "end=2025-03-31" \
--data-urlencode "symbols=OMIE_ES_DA,TTF_GAS,EUA_CO2" \
--data-urlencode "api_key=YOUR_API_KEY"

Sample response:

{
"success": true,
"base": "MIXED",
"start_date": "2025-01-01",
"end_date": "2025-03-31",
"rates": {
"OMIE_ES_DA": {
"2025-01-01": 64.20,
"2025-01-02": 62.50,
"2025-01-03": 67.10
},
"TTF_GAS": {
"2025-01-01": 46.80,
"2025-01-02": 47.10,
"2025-01-03": 48.00
},
"EUA_CO2": {
"2025-01-01": 83.40,
"2025-01-02": 82.70,
"2025-01-03": 84.10
}
},
"frequencies": {
"OMIE_ES_DA": "daily",
"TTF_GAS": "daily",
"EUA_CO2": "daily"
},
"currencies": {
"OMIE_ES_DA": "EUR",
"TTF_GAS": "EUR",
"EUA_CO2": "EUR"
}
}

How to use it:

  • Compute daily spreads: OMIE_ES_DA minus a CO2-adjusted thermal baseline implied by TTF_GAS and EUA_CO2.
  • Build training sets for activation classifiers—e.g., label days when price exceeds your flex threshold, then measure realized capacity value.
  • Export rates and currencies along with the start_date/end_date to a signed certification artifact for audits.

4) Intraday curves for dispatch alignment: GET /electricity/hourly

Flexibility products clear on hourly or sub-hourly blocks. Use the intraday curve to align DER activation windows to market settlement periods, calculate weighted-average prices for your offer bands, and compute real-time stack ranking across assets.

curl -G https://energy-api.com/api/v1/electricity/hourly \
--data-urlencode "symbol=OMIE_ES_DA" \
--data-urlencode "date=2026-06-11" \
--data-urlencode "api_key=YOUR_API_KEY"

Sample response (illustrative hours):

{
"success": true,
"symbol": "OMIE_ES_DA",
"date": "2026-06-11",
"currency": "EUR",
"interval": "hourly",
"curve": [
{"timestamp": "2026-06-11T00:00:00+01:00", "price": 58.30},
{"timestamp": "2026-06-11T01:00:00+01:00", "price": 56.90},
{"timestamp": "2026-06-11T02:00:00+01:00", "price": 55.10},
{"timestamp": "2026-06-11T03:00:00+01:00", "price": 54.20},
{"timestamp": "2026-06-11T04:00:00+01:00", "price": 55.00},
{"timestamp": "2026-06-11T05:00:00+01:00", "price": 59.80},
{"timestamp": "2026-06-11T06:00:00+01:00", "price": 63.40},
{"timestamp": "2026-06-11T07:00:00+01:00", "price": 71.20},
{"timestamp": "2026-06-11T08:00:00+01:00", "price": 76.60},
{"timestamp": "2026-06-11T09:00:00+01:00", "price": 73.20},
{"timestamp": "2026-06-11T10:00:00+01:00", "price": 68.10},
{"timestamp": "2026-06-11T11:00:00+01:00", "price": 66.70},
{"timestamp": "2026-06-11T12:00:00+01:00", "price": 65.90},
{"timestamp": "2026-06-11T13:00:00+01:00", "price": 66.30},
{"timestamp": "2026-06-11T14:00:00+01:00", "price": 67.80},
{"timestamp": "2026-06-11T15:00:00+01:00", "price": 70.40},
{"timestamp": "2026-06-11T16:00:00+01:00", "price": 74.10},
{"timestamp": "2026-06-11T17:00:00+01:00", "price": 78.20},
{"timestamp": "2026-06-11T18:00:00+01:00", "price": 82.10},
{"timestamp": "2026-06-11T19:00:00+01:00", "price": 80.90},
{"timestamp": "2026-06-11T20:00:00+01:00", "price": 75.50},
{"timestamp": "2026-06-11T21:00:00+01:00", "price": 70.30},
{"timestamp": "2026-06-11T22:00:00+01:00", "price": 66.80},
{"timestamp": "2026-06-11T23:00:00+01:00", "price": 62.40}
]
}

Usage tips:

  • The interval tells you the granularity (hourly or 15-min). Use it to align your dispatch controller and settlement buckets.
  • Store timestamp and price pairs verbatim with your bid objects. This makes later certification and dispute resolution straightforward.
  • For multi-country portfolios, fetch multiple curves in parallel and compute portfolio-level stack curves to decide which DERs to activate at which hours.

5) Grid carbon intensity: GET /carbon-intensity

Emissions-aware dispatch is becoming a market requirement. Combine electricity prices with country-level grid carbon intensity to rank flex offers not only by EUR/kWh benefit but also gCO2eq/kWh avoided or shifted. This supports ESG reporting and carbon-specific market incentives.

curl -G https://energy-api.com/api/v1/carbon-intensity \
--data-urlencode "country=DE" \
--data-urlencode "api_key=YOUR_API_KEY"

Sample response:

{
"success": true,
"country": "DE",
"unit": "gCO2eq/kWh",
"date": "2026-06-11",
"hourly": [
{"timestamp": "2026-06-11T00:00:00+02:00", "value": 269},
{"timestamp": "2026-06-11T01:00:00+02:00", "value": 261},
{"timestamp": "2026-06-11T02:00:00+02:00", "value": 255}
]
}

Use cases:

  • Compute an emissions-adjusted value function for dispatch: price benefit minus EUA_CO2-implied cost plus emissions reduction multiplier from carbon intensity.
  • Attach carbon context to every flex activation certificate. Your audit artifact can list timestamped intensity values used in settlement calculations.
  • Surface low-carbon windows to customer apps to encourage load shifting aligned with both price and emissions.

6) Deterministic day-ahead lookups: GET /forecast

For auction-sourced electricity symbols, you can retrieve the next published day-ahead result once it’s officially available. This is a deterministic lookup, not a predictive model. It is ideal for pre-activation planning, transparency in pre-bid quotes, and automated bid formation aligned to auction outcomes.

curl -G https://energy-api.com/api/v1/forecast \
--data-urlencode "symbol=EPEX_DE_DA" \
--data-urlencode "api_key=YOUR_API_KEY"

Sample response:

{
"success": true,
"symbol": "EPEX_DE_DA",
"currency": "EUR",
"date": "2026-06-12",
"values": [
{"timestamp": "2026-06-12T00:00:00+02:00", "price": 61.80},
{"timestamp": "2026-06-12T01:00:00+02:00", "price": 59.70},
{"timestamp": "2026-06-12T02:00:00+02:00", "price": 58.40}
],
"note": "Published auction results; non-predictive."
}

Practical guidance:

  • If a symbol is not auction-based, expect a 404. Handle it by falling back to /electricity/hourly for the latest cleared day or other operational logic.
  • Use the date and values arrays to pre-calculate the next day’s flex offer bands and to notify participating DERs of target windows.
  • Retain the note and date fields in your bid formation logs as proof of source and timing.

7) Fluctuation analytics: GET /fluctuation

To monitor market volatility and adjust flex bid buffers, pull start/end values and percentage changes across your planning horizon. This can feed margin adders, risk alerts, or automated widening of offer bands during high volatility.

curl -G https://energy-api.com/api/v1/fluctuation \
--data-urlencode "start=2026-06-01" \
--data-urlencode "end=2026-06-11" \
--data-urlencode "symbols=TTF_GAS,EUA_CO2,OMIE_ES_DA" \
--data-urlencode "api_key=YOUR_API_KEY"

Sample response:

{
"success": true,
"period": {"start": "2026-06-01", "end": "2026-06-11"},
"results": {
"TTF_GAS": {"start_value": 36.50, "end_value": 38.15, "change": 1.65, "change_pct": 4.52},
"EUA_CO2": {"start_value": 65.90, "end_value": 67.40, "change": 1.50, "change_pct": 2.28},
"OMIE_ES_DA": {"start_value": 60.20, "end_value": 64.80, "change": 4.60, "change_pct": 7.64}
}
}

Apply it to:

  • Dynamic margining: widen offer spreads when change_pct exceeds a threshold.
  • Anomaly detection: flag days where electricity and EUA_CO2 diverge significantly from historical correlations.
  • Hedging policy: adjust your hedge ratios based on recent fuel and electricity co-movements.

8) Simple wholesale cost estimation: POST /cost-estimate

If you need a rough monthly wholesale cost signal to communicate to end-users or to benchmark procurement options, use /cost-estimate. This endpoint multiplies the latest price by a provided kWh/month estimate. While it intentionally ignores taxes, network charges, and hourly usage profiles, it’s useful for UX hints and first-order planning.

curl -X POST https://energy-api.com/api/v1/cost-estimate \
-H "Content-Type: application/json" \
-d '{
"symbol": "OMIE_ES_DA",
"kwh_per_month": 1200
}'

Sample response:

{
"success": true,
"symbol": "OMIE_ES_DA",
"currency": "EUR",
"kwh_per_month": 1200,
"latest_price": 64.80,
"estimated_monthly_cost": 77.76,
"note": "Excludes taxes, network charges, and hourly profile effects."
}

Where it helps:

  • Customer-facing calculators to show potential benefit from flex participation.
  • Internal scenario planning when comparing procurement strategies or product price bands.
  • Baseline references for marketing messages tied to current wholesale conditions.

End-to-End Implementation Patterns

The endpoints above map to three core workflows for a flex market: pricing, aggregation, and certification. Below we outline a concrete pattern for each, using consistent JSON payloads and minimal glue code.

Pricing DER Flex Offers

Goal: compute a fair strike price for each device or portfolio band, incorporating electricity curves, fuel references, and emissions context.

  • Pull /electricity/hourly for the relevant market symbol and date to get the intraday curve that defines potential activation windows.
  • Pull /latest for TTF_GAS and EUA_CO2 to set an emissions-adjusted baseline or spark spread for thermal references.
  • Optionally pull /carbon-intensity for the country to rank windows by both price and emissions impact.

In practice, you might compute:

  • window_value = electricity_price(hour) - shadow_cost, where shadow_cost depends on TTF_GAS and EUA_CO2.
  • carbon_score = f(carbon_intensity(hour)) for emissions-aware ranking.
  • der_offer_price = window_value adjusted by device availability, cycle cost, and risk buffer from /fluctuation.

Store the raw inputs (curve, latest references, intensity) alongside the computed result for each submitted offer to support downstream certification.

Aggregating Device-Level Bids

Goal: combine hundreds of small DER offers into portfolio blocks that align with market lot sizes and minimize imbalance risk.

  • For each device, snap its availability to the intraday curve timestamps returned by /electricity/hourly.
  • Group devices by country_code or symbol from /symbols so you can aggregate only within compatible markets.
  • At each period, sort devices by der_offer_price and aggregate until you hit your block size. Retain each device’s marginal price and timestamp for settlement.

This produces a clean series of portfolio blocks (timestamp, MWh, price) ready to submit to your flexibility exchange or bilateral counterparties. Keep a slim record linking each device contribution to input references and the computed final block price.

Certification and Audit Trails

Goal: produce verifiable, timestamped proof of the input prices and carbon context used for settlement.

  • Attach to each settlement line item: the symbol names, the publishing date from /latest or /electricity/hourly, and the currency unit from currencies or currency fields.
  • Include a hash of the /timeseries or /electricity/hourly arrays used to price the transaction window, plus the /carbon-intensity hourly values relevant to those timestamps.
  • For day-ahead scheduled operations, include the /forecast payload for the specific date and symbol to prove that you used official auction results.

The result is a minimal, self-contained JSON proof that counterparties and auditors can validate without ambiguity.

Practical Code Examples

Developers often need a quick snippet to pull and combine multiple sources in one flow. Below are Python and JavaScript examples that fetch electricity curves, cross-commodity references, and carbon intensity to compute an emissions-aware flex ranking for a single day.

Python example: Emissions-aware window ranking

import requests
import datetime as dt

BASE = "https://energy-api.com/api/v1"
API_KEY = "YOUR_API_KEY"

def get_hourly_curve(symbol, date):
r = requests.get(f"{BASE}/electricity/hourly", params={
"symbol": symbol,
"date": date,
"api_key": API_KEY
})
r.raise_for_status()
return r.json()

def get_latest(symbols):
r = requests.get(f"{BASE}/latest", params={
"symbols": ",".join(symbols),
"api_key": API_KEY
})
r.raise_for_status()
return r.json()

def get_carbon_intensity(country):
r = requests.get(f"{BASE}/carbon-intensity", params={
"country": country,
"api_key": API_KEY
})
r.raise_for_status()
return r.json()

def emissions_aware_value(price, gas, eua, intensity):
# Simple illustration:
# shadow_cost = 0.2 * gas + 0.01 * eua (toy coefficients)
# emissions_benefit = max(0, 350 - intensity) * 0.01
shadow_cost = 0.2 * gas + 0.01 * eua
emissions_benefit = max(0, 350 - intensity) * 0.01
return price - shadow_cost + emissions_benefit

date = "2026-06-11"
symbol = "OMIE_ES_DA"
country = "ES"

curve = get_hourly_curve(symbol, date)
refs = get_latest(["TTF_GAS", "EUA_CO2"])
intensity = get_carbon_intensity(country)

gas = refs["rates"]["TTF_GAS"]
eua = refs["rates"]["EUA_CO2"]

intensity_map = {row["timestamp"]: row["value"] for row in intensity.get("hourly", [])}

ranked = []
for row in curve["curve"]:
ts = row["timestamp"]
price = row["price"]
# fallback if exact timestamp not in intensity, use same hour prefix
hour_key = ts[:13] # "YYYY-MM-DDTHH"
match = next((v for k,v in intensity_map.items() if k.startswith(hour_key)), None)
co2 = match if match is not None else 300
value = emissions_aware_value(price, gas, eua, co2)
ranked.append((ts, price, co2, value))

# top 5 windows
top5 = sorted(ranked, key=lambda x: x[3], reverse=True)[:5]
for ts, price, co2, val in top5:
print(ts, price, co2, round(val, 2))

JavaScript example: Portfolio block formation

const BASE = "https://energy-api.com/api/v1";
const API_KEY = "YOUR_API_KEY";

async function getJSON(url, params) {
const query = new URLSearchParams({ ...params, api_key: API_KEY });
const res = await fetch(`${url}?${query.toString()}`);
if (!res.ok) throw new Error(await res.text());
return res.json();
}

async function buildPortfolioBlock(symbol, date, devices) {
const curve = await getJSON(`${BASE}/electricity/hourly`, { symbol, date });
const refs = await getJSON(`${BASE}/latest`, { symbols: "TTF_GAS,EUA_CO2" });

const gas = refs.rates.TTF_GAS;
const eua = refs.rates.EUA_CO2;

const hours = curve.curve.map(p => ({
ts: p.timestamp,
price: p.price
}));

const blocks = [];
for (const h of hours) {
// Compute device-level marginal value (toy function)
const deviceVals = devices.map(d => {
const availability = d.isAvailable(h.ts) ? d.capacityMWh : 0;
const shadowCost = 0.2 * gas + 0.01 * eua + d.cycleCostEUR;
const value = h.price - shadowCost;
return { id: d.id, value, availability };
}).filter(x => x.availability > 0);

deviceVals.sort((a,b) => b.value - a.value);

let aggMWh = 0;
const chosen = [];
for (const dv of deviceVals) {
if (aggMWh >= 5.0) break; // example 5 MWh lot size
const take = Math.min(dv.availability, 5.0 - aggMWh);
aggMWh += take;
chosen.push({ id: dv.id, take, marginal: dv.value });
}
if (aggMWh > 0) {
const clearing = chosen[chosen.length - 1].marginal;
blocks.push({ ts: h.ts, mwh: aggMWh, price: Math.max(0, clearing), chosen });
}
}
return blocks;
}

Error Handling and Reliability

Even with clean upstream data, resilient systems plan for missing days, validations, and provider downtime. Energy API standardizes error codes and shapes so your client code can handle failure gracefully.

  • 401 Missing or invalid api_key: Ensure the api_key parameter is present and valid in your calls.
  • 404 Not found: No data for the given symbols or date. For example, forecasting a non-auction symbol returns 404. Prefer fallbacks (e.g., use /electricity/hourly for a nearby date) and log the occurrence.
  • 422 Validation error: You may have omitted a required parameter like date or symbol, or used an unsupported value. Validate inputs and surface actionable error messages to operators.
  • 429 Rate limit exceeded: Implement exponential backoff and jitter. If you are building a streaming-like poller for intraday curves, stagger requests per symbol and cache responses for your horizon.

All errors share a predictable shape:

{
"success": false,
"error": "Human-readable message."
}

Best practices:

  • Cache /symbols and static metadata in your service to avoid unnecessary discovery calls at runtime.
  • When charting or computing analytics across mixed currencies, normalize early or request a constrained base where supported.
  • Attach timestamped context (date, interval, currency) from responses to every derived value you store—this aids both debugging and certification.
  • Build light health checks with /status to watch upstream providers’ freshness, and pause certain recalculations during known maintenance windows.

Real-World Use Cases

1) Price Alert and Flex Triggering

A DER aggregator sets up intraday price alerts to trigger shifting behavior when OMIE_ES_DA hourly prices exceed a configured threshold and TTF_GAS or EUA_CO2 imply favorable spreads. The system polls /electricity/hourly for OMIE_ES_DA and /latest for TTF_GAS and EUA_CO2, computes a marginal value per hour, and notifies the orchestration controller to schedule charge/discharge or curtailment.

2) ESG Dashboard with Emissions-Aware Economics

A utility’s sustainability team builds a dashboard that overlays day-ahead curves with grid carbon intensity for DE, FR, and ES. It uses /electricity/hourly for market prices, /carbon-intensity for emissions, and /timeseries for historical trend comparisons. The dashboard ranks operational windows by net financial benefit and gCO2eq/kWh avoided, giving product teams a defendable narrative for decarbonization impact.

3) Retail Cost Calculator and Hedging Coach

A fintech app provides a wholesale cost estimate and a hedging suggestion for small businesses. It consumes /cost-estimate with OMIE_ES_DA or EPEX_DE_DA plus /latest for TTF_GAS and BRENT_CRUDE to contextualize fuel market trends. Users see a transparent, market-linked monthly cost estimate and can simulate flex participation benefits under different macro conditions.

Additional Endpoint Highlights for Energy Teams

Beyond the core endpoints above, several category endpoints can simplify common workflows:

  • GET /electricity/latest: Pull the latest prices for all electricity symbols—or filter by country. Useful for quick status boards across your operating geographies without listing symbols manually.
  • GET /gas/latest: Single call for TTF_GAS and HENRY_HUB. Great for risk dashboards comparing EU and US gas references.
  • GET /emissions/latest: Fetch EUA_CO2 quickly when you only need allowance prices without other series.
  • GET /coal/latest: Grab COAL_ROTTERDAM (API2) and COAL_NEWCASTLE to enrich thermal generation economics and baseline comparisons.
  • GET /status: Monitor provider freshness to time recalculations and reduce noisy alerts during known upstream maintenance.

Field-by-Field Interpretation Cheat Sheet

Across endpoints you will see repeatable fields designed for composability:

  • success: Boolean guard; always check before dereferencing arrays.
  • date, start_date, end_date: Anchor your calculations to clear time boundaries and store these in your certification trails.
  • rates (object keyed by symbol): Values keyed by ISO date, or immediate values for /latest.
  • currencies, currency: Keep units explicit. In mixed commodity calls, track currency per symbol.
  • curve or values arrays: Ordered, timestamped pairs for intraday or day-ahead schedules.
  • frequencies: Helps resample series and avoid aliasing errors in backtests.
  • unit: For carbon intensity, tells you gCO2eq/kWh so you can compute impact metrics consistently.

Putting It All Together: A Reference Workflow

Here’s a concise end-to-end path for a daily flex operation in Spain and Germany:

  • 06:00: Call /symbols with category=electricity to confirm active symbols for ES and DE. Cache results.
  • 06:05: If auction results are posted, call /forecast for OMIE_ES_DA and EPEX_DE_DA dates to finalize the next-day schedule baseline.
  • 06:10: For same-day operations, call /electricity/hourly for OMIE_ES_DA to get the live intraday curve for date=T0. In parallel, pull /latest for TTF_GAS and EUA_CO2.
  • 06:12: Call /carbon-intensity for ES and DE to populate emissions weights per hour.
  • 06:15: Compute device-level offer prices and aggregate blocks per hour. Use /fluctuation across the last 7–10 days for dynamic risk buffers.
  • 06:20: Submit offers to your flexibility exchange or control system. Persist inputs, timestamps, and currencies.
  • Post-activation: Export a certification JSON with the exact inputs from /electricity/hourly, /latest, /forecast (if used), and /carbon-intensity for the relevant hours.

FAQ

How often does the TTF gas price update?

TTF_GAS is fetched from official sources on their publishing schedule and exposed via /latest and /timeseries with consistent JSON. You can always check the dates field in /latest or the per-date keys in /timeseries to confirm the most recent available publication for your calculations.

Can I get historical energy prices going back multiple years?

Yes. Use /timeseries with start and end to pull historical series for electricity, gas, oil, coal, and carbon. The response includes frequencies and currencies so you can align series correctly in your backtests and reporting.

Does the API support multiple commodities in a single call?

Yes. Endpoints like /latest and /timeseries accept multiple symbols, even across categories. This is ideal for building composite indices, spreads, and emissions-adjusted pricing functions without additional integrations.

Can I access hourly intraday electricity curves?

Where sources publish them, yes. Use /electricity/hourly with symbol and date to retrieve hourly or 15-min intervals. The response includes interval granularity and timestamped price points ready for dispatch alignment and settlement mapping.

What happens if data for a symbol isn’t available on a given date?

For endpoints like /historical, if a date falls on a non-publishing day, the API returns the most recent prior value. Other endpoints may return 404 when the requested data type isn’t applicable (e.g., /forecast for non-auction symbols). Always check the success flag and handle 404/422 responses with sensible fallbacks.

Conclusion + Call to Action

Flexibility markets reward clarity: clear input prices, clear aggregation rules, and clear certification artifacts. Building that clarity on top of inconsistent upstream feeds is costly and fragile. With Energy API, you get a single, normalized interface spanning electricity curves, gas and oil references, carbon allowances, coal benchmarks, and grid carbon intensity—all with the same JSON ergonomics and predictable error behavior.

Whether you are calibrating day-ahead flex bands, orchestrating intraday dispatch, or exporting auditable settlement packages, this unified approach cuts engineering time dramatically and reduces operational risk. You can integrate cross-commodity inputs in one call, align dispatch to settlement periods with intraday curves, and attach standardized carbon context to every activation.

Build your next flex-pricing feature today. Explore symbols, query cross-commodity /latest snapshots, fetch /electricity/hourly curves, and stitch it all into your pricing and certification flows. Try Energy API for free and move from prototype to production-grade flexibility services with confidence.

Ready to get started?

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

Get API Key

Related posts