From Curtailment Notice to Automated Settlement: Orchestrating DER Aggregator Workflows with Energy API and ISO Market Feeds

From Curtailment Notice to Automated Settlement: Orchestrating DER Aggregator Workflows with Energy API and ISO Market Feeds

Distributed Energy Resource (DER) aggregators live at the edge of volatility. When a curtailment notice lands, you have minutes—not hours—to re-optimize dispatch instructions, hedge exposures, and prepare for settlement. The friction isn’t building optimization logic; it’s reconciling mismatched data formats from ISOs, government portals, and market operators, then threading those data into a pipeline that actually survives production traffic and day-to-day market changes. If you’ve ever scraped an ISO portal at 2 a.m. for a hotfix, you know the pain.

This post shows how to go from curtailment notice to automated settlement by orchestrating DER aggregator workflows with unified market data from Energy API and official ISO market feeds it aggregates. We’ll walk through how a single normalized JSON surface replaces complex data wrangling from sources like OMIE, ENTSO-E, ESIOS, EIA/FRED, and Ember. You’ll learn which endpoints to combine for dispatch decisions, intraday curves, day-ahead auction results, and carbon intensity—plus how to build reliability into your pipeline with health checks and robust error handling.

Whether you’re optimizing batteries across Spain and Germany, serving PV/battery retail tariffs that track OMIE day-ahead, or estimating portfolio-level emissions with real-time carbon intensity, the fastest path to a reliable production system is eliminating format differences and schedule idiosyncrasies. Let’s make the data layer boring—so you can focus on orchestration and value.

Why Energy API

Aggregating official energy data is not a one-time ETL job—it’s a moving target. Publication schedules change, symbols get renamed, and intraday formats vary by country and ISO. Energy API normalizes everything into a consistent JSON schema across electricity, gas, oil, coal, carbon allowances, and grid carbon intensity—so your application code doesn’t need to know whether a price came from OMIE or ENTSO-E to do the right thing.

  • One surface for many sources: Instead of writing and maintaining scrapers for OMIE, ENTSO-E, ESIOS, EIA/FRED, and Ember, call one REST API with stable endpoints. Your system gains elastic resilience as publication quirks are abstracted away, and your engineering backlog shrinks.
  • Same JSON across commodities: Electricity, gas, oil, coal, carbon, and carbon intensity share the same response patterns. Shipping features like cross-commodity alerts or portfolio dashboards becomes a few lines of code, not weeks of schema juggling.
  • Symbols that travel: 39+ symbols normalized with currency and frequency metadata let you query multiple commodities in a single call. For DER bidding and settlement, you can retrieve OMIE day-ahead, TTF gas, and EUA carbon allowances together—and act on a portfolio basis.
  • Curves, forecasts, and health checks: Intraday electricity curves, deterministic day-ahead forecast lookups (for auction-sourced symbols), fluctuation analysis, and provider status endpoints give you the primitives for a robust real-time workflow. Implement retries/backoff, circuit breakers, and monitoring from day one.

Quick Start

Base URL:

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

First request: fetch the most recent prices for multiple commodities in one shot. This is useful when your DER control loop needs to factor in electricity spot, gas backstop fuel, and EUA carbon in the same decision window.

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

Sample JSON response:

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

What matters:

  • rates: Keyed by symbol, this is the value you’ll use for pricing logic. For DERs in Spain, OMIE_ES_DA drives day-ahead settlement and price-capped bidding strategies.
  • dates: The effective date for each symbol. Some commodities publish at different times; use this to guard against mixing stale and current data.
  • currencies: Keep currency conversions consistent across your portfolio analytics.

Core Endpoints for DER Orchestration

The following endpoints form the backbone of a DER aggregator pipeline, from intraday operations through settlement and post-event analysis. We’ll show cURL examples, complete JSON payloads, and how to interpret each response in your control loop.

1) GET /electricity/hourly — Intraday curves for dispatch and settlement

Purpose: Retrieve the full intraday curve (15-minute or hourly, depending on source) for a given electricity symbol and date. Use this to align dispatch with the price shape across the day, run curtailment impact analysis, and sanity-check day-ahead vs intraday realized spreads.

Key params:

  • symbol (required): e.g., OMIE_ES_DA, EPEX_DE_DA
  • date (required): YYYY-MM-DD
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 JSON response:

{
"success": true,
"symbol": "OMIE_ES_DA",
"date": "2026-06-11",
"frequency": "hourly",
"currency_code": "EUR",
"points": [
{"interval_start": "2026-06-11T00:00:00Z", "value": 76.10},
{"interval_start": "2026-06-11T01:00:00Z", "value": 72.40},
{"interval_start": "2026-06-11T02:00:00Z", "value": 70.55},
{"interval_start": "2026-06-11T03:00:00Z", "value": 68.20},
{"interval_start": "2026-06-11T04:00:00Z", "value": 69.75},
{"interval_start": "2026-06-11T05:00:00Z", "value": 74.30},
{"interval_start": "2026-06-11T06:00:00Z", "value": 81.10},
{"interval_start": "2026-06-11T07:00:00Z", "value": 94.60},
{"interval_start": "2026-06-11T08:00:00Z", "value": 106.80},
{"interval_start": "2026-06-11T09:00:00Z", "value": 112.25},
{"interval_start": "2026-06-11T10:00:00Z", "value": 115.00},
{"interval_start": "2026-06-11T11:00:00Z", "value": 117.35},
{"interval_start": "2026-06-11T12:00:00Z", "value": 118.90},
{"interval_start": "2026-06-11T13:00:00Z", "value": 116.45},
{"interval_start": "2026-06-11T14:00:00Z", "value": 109.75},
{"interval_start": "2026-06-11T15:00:00Z", "value": 102.00},
{"interval_start": "2026-06-11T16:00:00Z", "value": 98.10},
{"interval_start": "2026-06-11T17:00:00Z", "value": 101.60},
{"interval_start": "2026-06-11T18:00:00Z", "value": 107.40},
{"interval_start": "2026-06-11T19:00:00Z", "value": 111.30},
{"interval_start": "2026-06-11T20:00:00Z", "value": 104.20},
{"interval_start": "2026-06-11T21:00:00Z", "value": 96.85},
{"interval_start": "2026-06-11T22:00:00Z", "value": 88.40},
{"interval_start": "2026-06-11T23:00:00Z", "value": 81.90}
]
}

How to use it:

  • points[].interval_start: Timestamp to align your dispatch or settlement window. If your DER telemetry is 15-min granularity, aggregate or interpolate accordingly.
  • points[].value: Price in currency_code per MWh. Multiply by interval kWh to estimate interval revenue/cost for settlement or optimization.
  • frequency: Use to verify your scheduler’s step size (hourly vs 15-min).

2) GET /forecast — Deterministic day-ahead auction results

Purpose: For auction-sourced electricity symbols, this returns the next published day-ahead price—crucial for constructing tomorrow’s dispatch schedule on publication. Note this is a deterministic lookup of already-published results (not a predictive model).

Key params:

  • symbol (required): e.g., OMIE_ES_DA, EPEX_DE_DA
curl -G https://energy-api.com/api/v1/forecast \
--data-urlencode "symbol=OMIE_ES_DA" \
--data-urlencode "api_key=YOUR_API_KEY"

Sample JSON response:

{
"success": true,
"symbol": "OMIE_ES_DA",
"forecast_date": "2026-06-12",
"frequency": "hourly",
"currency_code": "EUR",
"points": [
{"interval_start": "2026-06-12T00:00:00Z", "value": 78.50},
{"interval_start": "2026-06-12T01:00:00Z", "value": 75.30},
{"interval_start": "2026-06-12T02:00:00Z", "value": 73.90},
{"interval_start": "2026-06-12T03:00:00Z", "value": 72.15},
{"interval_start": "2026-06-12T04:00:00Z", "value": 72.80},
{"interval_start": "2026-06-12T05:00:00Z", "value": 77.00},
{"interval_start": "2026-06-12T06:00:00Z", "value": 85.10},
{"interval_start": "2026-06-12T07:00:00Z", "value": 98.60},
{"interval_start": "2026-06-12T08:00:00Z", "value": 110.20},
{"interval_start": "2026-06-12T09:00:00Z", "value": 114.00},
{"interval_start": "2026-06-12T10:00:00Z", "value": 116.90},
{"interval_start": "2026-06-12T11:00:00Z", "value": 118.40},
{"interval_start": "2026-06-12T12:00:00Z", "value": 119.10},
{"interval_start": "2026-06-12T13:00:00Z", "value": 117.70},
{"interval_start": "2026-06-12T14:00:00Z", "value": 111.60},
{"interval_start": "2026-06-12T15:00:00Z", "value": 104.90},
{"interval_start": "2026-06-12T16:00:00Z", "value": 101.10},
{"interval_start": "2026-06-12T17:00:00Z", "value": 104.50},
{"interval_start": "2026-06-12T18:00:00Z", "value": 109.70},
{"interval_start": "2026-06-12T19:00:00Z", "value": 113.10},
{"interval_start": "2026-06-12T20:00:00Z", "value": 105.40},
{"interval_start": "2026-06-12T21:00:00Z", "value": 97.60},
{"interval_start": "2026-06-12T22:00:00Z", "value": 89.20},
{"interval_start": "2026-06-12T23:00:00Z", "value": 83.00}
]
}

How to use it:

  • forecast_date: Tomorrow’s operational calendar for your scheduling service. Generate instructions when publication lands; store for reconciliation against realized curves.
  • points: Directly drive your DER baseline or price-sensitive bidding windows.
  • Errors: A 404 indicates a symbol that isn’t auction-sourced or not yet published. Implement a wait-and-retry loop with exponential backoff.

3) GET /timeseries — Historical series for trend, backtests, and anomaly detection

Purpose: Fetch historical series for one or more symbols between two dates. This supports model baselining, risk factor analysis, and validation of dispatch heuristics against historical price regimes.

Key params:

  • start (required): YYYY-MM-DD
  • end (required): YYYY-MM-DD
  • symbols (required): comma-separated symbols
curl -G https://energy-api.com/api/v1/timeseries \
--data-urlencode "start=2025-12-01" \
--data-urlencode "end=2026-01-15" \
--data-urlencode "symbols=OMIE_ES_DA,TTF_GAS,EUA_CO2" \
--data-urlencode "api_key=YOUR_API_KEY"

Sample JSON response:

{
"success": true,
"base": "MIXED",
"start_date": "2025-12-01",
"end_date": "2026-01-15",
"rates": {
"OMIE_ES_DA": {
"2025-12-01": 84.10,
"2025-12-02": 83.50
},
"TTF_GAS": {
"2025-12-01": 41.80,
"2025-12-02": 42.15
},
"EUA_CO2": {
"2025-12-01": 69.40,
"2025-12-02": 69.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:

  • rates: Map of symbol to date-indexed values. Feed this into analytics for seasonal price shape analysis or risk-driven reserve strategies.
  • frequencies: Validate aggregation pipeline assumptions (e.g., daily vs intraday).
  • Multiple symbols: Build cross-commodity regressions or cost pass-through models for hybrid portfolios (battery + gas peaker + guarantees of origin).

4) GET /fluctuation — Windowed change, useful for alerting and risk buffers

Purpose: Retrieve start/end values, absolute change, and percentage change over a period. For DER control, this powers safety buffers when volatility spikes, keeps your deviation penalties in check, and helps tune price-sensitive bids.

Key params:

  • start (required), end (required): YYYY-MM-DD
  • symbols (required): comma-separated
curl -G https://energy-api.com/api/v1/fluctuation \
--data-urlencode "start=2026-06-01" \
--data-urlencode "end=2026-06-11" \
--data-urlencode "symbols=OMIE_ES_DA,TTF_GAS,EUA_CO2" \
--data-urlencode "api_key=YOUR_API_KEY"

Sample JSON response:

{
"success": true,
"base": "MIXED",
"start_date": "2026-06-01",
"end_date": "2026-06-11",
"symbols": {
"OMIE_ES_DA": {
"start_value": 88.20,
"end_value": 92.15,
"change": 3.95,
"change_pct": 4.48
},
"TTF_GAS": {
"start_value": 35.80,
"end_value": 38.15,
"change": 2.35,
"change_pct": 6.56
},
"EUA_CO2": {
"start_value": 65.10,
"end_value": 67.40,
"change": 2.30,
"change_pct": 3.53
}
}
}

How to use it:

  • change_pct: If short-term volatility is high, tighten your curtailment margin or increase reserve to reduce imbalance risk.
  • Multiple symbols: Drive weighted-average hedge strategies and alerts across power, fuel, and carbon.

5) GET /status — Operational visibility for health checks and circuit breakers

Purpose: Returns last fetch status for each provider. Use it to implement circuit breakers and fallback strategies in your pipeline—especially around publication time or during maintenance windows.

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

Sample JSON response:

{
"success": true,
"providers": [
{
"name": "OMIE",
"last_success": "2026-06-11T10:05:00Z",
"last_error": null,
"status": "healthy"
},
{
"name": "ENTSO-E",
"last_success": "2026-06-11T09:58:00Z",
"last_error": null,
"status": "healthy"
},
{
"name": "ESIOS",
"last_success": "2026-06-11T09:59:00Z",
"last_error": "2026-06-11T08:42:00Z: transient timeout",
"status": "degraded"
}
]
}

How to use it:

  • status: healthy, degraded, or down. If degraded, widen retry intervals and consider using the last known good curve with confidence flags.
  • last_success / last_error: Anchor your fallback time horizons and trigger alerts.

Expanding the Toolkit: All Available Endpoints and Business Value

While the core endpoints above power most DER workflows, Energy API includes a broader set of features to streamline analytics, monitoring, and reporting. Below is a practical overview of each endpoint’s purpose and how it drives value in operations, risk, or product features.

Discovery and Metadata

  • GET /symbols — Discover active symbols by category, provider, and currency. Use this to drive dynamic configuration for new markets.
curl -G https://energy-api.com/api/v1/symbols \
--data-urlencode "category=electricity" \
--data-urlencode "api_key=YOUR_API_KEY"
{
"success": true,
"count": 4,
"symbols": [
{
"symbol": "OMIE_ES_DA",
"name": "OMIE Spain Day-Ahead",
"category": "electricity",
"country_code": "ES",
"currency_code": "EUR",
"frequency": "daily",
"description": "OMIE day-ahead auction."
},
{
"symbol": "EPEX_DE_DA",
"name": "EPEX Germany Day-Ahead",
"category": "electricity",
"country_code": "DE",
"currency_code": "EUR",
"frequency": "daily",
"description": "EPEX day-ahead."
},
{
"symbol": "PVPC_ES_2TD",
"name": "PVPC Spain 2TD Retail Reference",
"category": "electricity",
"country_code": "ES",
"currency_code": "EUR",
"frequency": "hourly",
"description": "Spanish PVPC reference prices."
},
{
"symbol": "AEMO_NSW1",
"name": "AEMO New South Wales Price",
"category": "electricity",
"country_code": "AU",
"currency_code": "AUD",
"frequency": "hourly",
"description": "AEMO intraday curves."
}
]
}

Practical use:

  • Use metadata to select symbols programmatically per country_code when onboarding new DER assets or expanding your coverage.
  • frequency tells you whether to expect hourly or 15-min points, enabling automated scheduler configuration.

Unified Market Prices

  • GET /latest — Most recent price for one or more symbols. Power dashboards, alerts, and cross-commodity analytics.
  • GET /historical — Snapshot prices on a specific date; returns the nearest previous value if a non-publishing day. Use to reconcile historical settlements.
  • GET /timeseries — Already covered; use for trend/backtests and rolling analyses.
  • GET /fluctuation — Already covered; power alerts and volatility-aware controls.
  • GET /ohlc — Weekly/monthly/quarterly candles for volatility analysis or portfolio risk visuals.
curl -G https://energy-api.com/api/v1/ohlc \
--data-urlencode "symbols=OMIE_ES_DA,TTF_GAS" \
--data-urlencode "period=monthly" \
--data-urlencode "start=2025-01-01" \
--data-urlencode "end=2025-12-31" \
--data-urlencode "api_key=YOUR_API_KEY"
{
"success": true,
"symbols": {
"OMIE_ES_DA": [
{"period": "2025-01", "open": 82.10, "high": 120.40, "low": 60.50, "close": 88.30, "data_points": 31},
{"period": "2025-02", "open": 88.30, "high": 118.10, "low": 62.40, "close": 90.75, "data_points": 28}
],
"TTF_GAS": [
{"period": "2025-01", "open": 45.80, "high": 58.20, "low": 41.60, "close": 47.10, "data_points": 31},
{"period": "2025-02", "open": 47.10, "high": 55.00, "low": 42.90, "close": 46.20, "data_points": 28}
]
}
}

OHLC tips:

  • Use high/low spreads to tune maximum allowable exposure per node or region.
  • Compare electricity OHLC to fuel and carbon OHLC to validate pass-through assumptions in your retail products.

Category-Specific Shortcuts

  • GET /electricity/latest — Fetch the latest prices for all electricity symbols, optionally filtered by country. Good for region-wide portfolio snapshots.
  • GET /electricity/hourly — Covered earlier; intraday dispatch and settlement curves.
  • GET /electricity/pvpc — Hourly Spanish PVPC retail reference prices. Perfect for customer-facing tariff explainers and transparent billing models.
  • GET /gas/latest — Return TTF_GAS and HENRY_HUB together. Useful for gas-indexed hedges or cross-market comparisons.
  • GET /emissions/latest — Return EUA_CO2 for EU ETS. Input for carbon cost pass-through.
  • GET /coal/latest — Coal indices for broader fuel stack analysis or historical power price attribution.
  • GET /carbon-intensity — Grid carbon intensity by country, gCO2eq/kWh. Use to compute time-based emissions for your DER portfolio.
curl -G https://energy-api.com/api/v1/carbon-intensity \
--data-urlencode "country=DE" \
--data-urlencode "api_key=YOUR_API_KEY"
{
"success": true,
"country": "DE",
"unit": "gCO2eq/kWh",
"date": "2026-06-11",
"value": 308.4
}

Emissions usage:

  • Multiply interval kWh by carbon intensity to calculate time-based emissions for ESG reports or carbon-aware dispatch (e.g., charging batteries when intensity is lower).

Forecasts, Costing, and Health

  • GET /forecast — Covered earlier; deterministic auction results for day-ahead scheduling.
  • POST /cost-estimate — Multiply the latest price by a given monthly kWh to derive a simple wholesale cost estimate. Good for quoting and scenario testing.
  • GET /status — Covered earlier; operate with confidence using health signals.
curl -X POST https://energy-api.com/api/v1/cost-estimate \
-H "Content-Type: application/json" \
-d '{
"symbol": "OMIE_ES_DA",
"kwh_per_month": 12500
}' \
--data-urlencode "api_key=YOUR_API_KEY"
{
"success": true,
"symbol": "OMIE_ES_DA",
"kwh_per_month": 12500,
"currency_code": "EUR",
"latest_price": 92.15,
"estimated_monthly_cost": 1151.88,
"note": "Estimate uses the most recent price; excludes taxes, network charges, and hourly usage profiles."
}

Notes:

  • Use this for high-level quoting or sensitivity analysis; actual bills and settlements require interval-level application of prices to load/generation profiles.

From Curtailment Notice to Automated Settlement: A Reference Workflow

Below is a practical sequence you can implement to respond to curtailment and push through to automated settlement in a DER aggregator stack:

  1. Detect curtailment: Your grid signals or ISO notifications arrive. Determine affected regions and assets.
  2. Assess latest market state: Call /latest with electricity, gas, and EUA to snapshot cross-commodity context. If volatility is high (use /fluctuation), widen your risk buffers for bid/ask decisions.
  3. Align to curves: Pull /electricity/hourly for today’s intraday and, once published, /forecast for tomorrow’s day-ahead. Compare to expected shape to re-optimize dispatch instructions.
  4. Incorporate carbon intensity: Call /carbon-intensity by country to adjust dispatch for emissions targets or customer ESG objectives.
  5. Health checks: Query /status. If a provider is degraded, temporarily pin to last_success values and flag reduced confidence to your operators.
  6. Settle and reconcile: Use /historical to retrieve the appropriate prices for settlement dates, or /timeseries for ranges. Compute revenue/cost by interval, validate against intraday vs day-ahead spreads, and export to finance.
  7. Report and analyze: Feed aggregated results into your ESG dashboard with emissions calculations, and visualize volatility via /ohlc to inform future strategy.

This workflow removes a brittle web of scrapers, time parsers, and schema-specific branches. One JSON contract keeps your pipeline clear and your operations team focused on action.

Implementation Guidance and Best Practices

Even with a normalized data surface, resilient systems require good operational patterns. Here are concrete tips for building production-ready DER orchestration with Energy API.

  • Polling and synchronization:
    • Publication times vary across ISOs. Use /status to decide whether to poll frequently (healthy) or back off (degraded).
    • Cache last known good curves to prevent gaps during provider outages; add metadata to mark derived vs confirmed data in your data store.
  • Retries and backoff:
    • Implement exponential backoff on 429 responses. Stagger fetch windows by region and commodity to avoid thundering herds around auction publication.
    • On 404 from /forecast, schedule a short retry loop since publication may be minutes away.
  • Circuit breakers:
    • If /status indicates degraded, route operations to a fallback plan: widen tolerance bands, suppress non-critical alerts, and reduce forecast reliance.
    • Automatically restore normal operation after consecutive healthy polls.
  • Data modeling:
    • Persist price series with symbol, currency_code, frequency, and effective dates. Keep interval_start aligned to UTC to minimize daylight saving complexity.
    • For retail or settlement-grade computations, store the original points as well as your aggregated intervals to preserve auditability.
  • Cross-commodity calls:
    • Whenever possible, request multiple symbols in a single /latest or /timeseries call to reduce fan-out and improve consistency.
  • Validation and alarms:
    • Use /fluctuation or your own rolling windows to detect outliers. Automatically compare day-ahead to intraday realized averages for quality control.

Real-World Use Cases

1) Intraday Price Alerting and Re-Dispatch

When mid-day volatility exceeds a risk threshold, you want automated re-dispatch rules to protect margins. Build a small service that calls /fluctuation every 15 minutes across OMIE_ES_DA, TTF_GAS, and EUA_CO2. If change_pct exceeds your threshold, dispatch logic calls /electricity/hourly to recompute the remainder-of-day profile and adjust bids.

Endpoints: /fluctuation, /electricity/hourly, /latest

2) Carbon-Aware Battery Charging Windows

If your customer has emissions constraints, combine electricity curves from /electricity/hourly with regional carbon intensity from /carbon-intensity. Select low-intensity hours to charge and high-price hours to discharge, subject to SOC and network limits. Persist both cost and emissions to support ESG reports and guarantee-of-origin contracts.

Endpoints: /electricity/hourly, /carbon-intensity

3) Retail Quoter for PVPC-Indexed Tariffs

Offer transparent retail quotes by pulling Spanish PVPC hourly prices via /electricity/pvpc and rolling them into a customer’s monthly kWh profile. Validate the ballpark with POST /cost-estimate. Use /timeseries to show historical comparisons and explain seasonal changes to the customer.

Endpoints: /electricity/pvpc, /timeseries, /cost-estimate

Deep Dive: Error Handling and Troubleshooting

A production pipeline needs to handle transient network issues, provider outages, and validation mismatches gracefully. Energy API standardizes error responses and status codes to help you respond intelligently.

  • 401 — Missing or invalid authentication. Verify your query parameters and avoid sending secrets in logs. Automated tests should simulate missing credentials to validate your error path.
  • 404 — No data for the given symbols or date. For /forecast, this likely means the next auction data isn’t published yet. Implement a retry with exponential backoff and jitter.
  • 422 — Validation error. Confirm symbols, date formats (YYYY-MM-DD), and supported values. Prevent 422s at source by using /symbols to build a dropdown or schema-enforced config for supported items.
  • 429 — Rate limit exceeded. Back off exponentially and switch to cache reads. Consider batching symbols in single calls to minimize request counts.

Error response shape:

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

Operational tips:

  • Always log the endpoint, query parameters, and http_status with a unique request_id for correlation across services.
  • Implement synthetic canaries: periodically fetch a known symbol like OMIE_ES_DA with /latest to prove the path from your runtime to Energy API and catch DNS/TLS/regression issues early.
  • Add observability panels: display /status next to your dispatch scheduler dashboard so operators can see provider health at a glance.

Practical Code Examples

Below are platform-agnostic examples that illustrate basic usage patterns in scripts and services.

Bash (cURL) — Multi-commodity snapshot for a control loop

#!/usr/bin/env bash
set -euo pipefail

API="https://energy-api.com/api/v1"
KEY="YOUR_API_KEY"
SYMS="OMIE_ES_DA,TTF_GAS,EUA_CO2"

resp=$(curl -sG "$API/latest" \
--data-urlencode "symbols=$SYMS" \
--data-urlencode "api_key=$KEY")

echo "$resp" | jq .

Use cases:

  • Run every 5 minutes during operating hours; on changes against your last snapshot, kick off a recalculation.

Python — Retrieve intraday curve and compute interval revenue

import os
import requests
from datetime import datetime, timezone

API = "https://energy-api.com/api/v1"
KEY = os.getenv("ENERGY_API_KEY")
SYMBOL = "OMIE_ES_DA"
DATE = "2026-06-11"

params = {"symbol": SYMBOL, "date": DATE, "api_key": KEY}
r = requests.get(f"{API}/electricity/hourly", params=params, timeout=30)
r.raise_for_status()
data = r.json()

# Example: simple 1 MW export at every hour
interval_mwh = 1.0
revenue = sum(pt["value"] * interval_mwh for pt in data["points"])
print(f"Estimated revenue for {DATE}: {revenue:.2f} {data['currency_code']}")

Tip: For 15-min data, set interval_mwh to MW * 0.25 and align timestamps to your telemetry for settlement-grade accuracy.

JavaScript (Node) — Compare tomorrow’s day-ahead to today’s realized average

import fetch from "node-fetch";

const API = "https://energy-api.com/api/v1";
const KEY = process.env.ENERGY_API_KEY;
const SYMBOL = "OMIE_ES_DA";

async function getForecast() {
const url = new URL(`${API}/forecast`);
url.searchParams.set("symbol", SYMBOL);
url.searchParams.set("api_key", KEY);
const r = await fetch(url);
if (!r.ok) throw new Error(`${r.status} ${await r.text()}`);
return r.json();
}

async function getHourly(date) {
const url = new URL(`${API}/electricity/hourly`);
url.searchParams.set("symbol", SYMBOL);
url.searchParams.set("date", date);
url.searchParams.set("api_key", KEY);
const r = await fetch(url);
if (!r.ok) throw new Error(`${r.status} ${await r.text()}`);
return r.json();
}

function avg(points) {
return points.reduce((sum, p) => sum + p.value, 0) / points.length;
}

(async () => {
const fc = await getForecast();
const forecastAvg = avg(fc.points);

// Compare to a known realized day (yesterday)
const yesterday = new Date(Date.now() - 24*3600*1000).toISOString().slice(0,10);
const intraday = await getHourly(yesterday);
const realizedAvg = avg(intraday.points);

console.log(`Realized avg (${yesterday}): ${realizedAvg.toFixed(2)} ${intraday.currency_code}`);
console.log(`Forecast avg (${fc.forecast_date}): ${forecastAvg.toFixed(2)} ${fc.currency_code}`);
})();

Use this pattern to highlight forecast-to-realized deltas for operator review or automated tuning of schedule assumptions.

FAQ

How often does the TTF gas price update?

TTF_GAS is provided as a daily frequency series. Use /latest for the most recent value, /historical for a specific date snapshot (with nearest-previous fallback on non-publishing days), and /timeseries for ranges. For short-term volatility assessment, pair TTF with electricity /fluctuation over your desired window.

Can I query electricity, gas, and carbon in one call?

Yes. Endpoints like /latest and /timeseries accept multiple, comma-separated symbols across categories (e.g., OMIE_ES_DA, TTF_GAS, and EUA_CO2 together). This is ideal for portfolio-level decision-making and reduces coordination overhead across services.

Do you provide intraday curves for electricity?

Yes, where sources publish them. Use /electricity/hourly to retrieve full intraday curves (hourly or 15-min depending on the source) for a given symbol and date. This is essential for dispatch, settlement calculations, and visualizing daily price shape.

Can I get historical energy prices going back several years?

Use /timeseries to request ranges by start and end dates. Coverage depends on the underlying sources; build your analytics with symbol metadata and validate assumptions using /symbols and your own historical queries.

Does the API support different currencies for different symbols?

Yes. Each symbol returns its native currency in the currencies field (for multi-symbol endpoints) or currency_code (for category endpoints). Your application should handle mixed-currency results by normalizing or annotating values before portfolio aggregation.

Conclusion + CTA

When curtailment hits, the bottleneck shouldn’t be your data layer. With a single, normalized interface across electricity, gas, oil, coal, carbon allowances, and grid carbon intensity, Energy API lets you move from price fetch to dispatch action in minutes—not weeks of ETL. You can automate end-to-end: pull intraday curves, lock day-ahead schedules the moment they’re published, calculate emissions, and reconcile for settlement with the same JSON patterns across markets and sources.

If you’re building DER aggregator workflows, risk dashboards, or carbon-aware products, make the data foundation boring and robust. Use cross-commodity calls to simplify logic, health checks to survive publication spikes, and historical series to validate your strategies. This is the shortest path from an operator alert to a confident, automated response—and the groundwork for scalable growth into new markets.

Start building with the endpoints in this guide and expand as your portfolio evolves. Explore all symbols and categories on Energy API, and ship your next feature without getting tangled in ISO quirks or portal scraping. Try Energy API for free and take your DER orchestration from reactive to reliable.

Ready to get started?

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

Get API Key

Related posts