Historical TTF Gas Prices

Historical TTF Gas Prices

You need reliable, historical TTF gas price data for finance workflows like PnL attribution, hedging backtests, or risk modeling—and you want to fetch it programmatically as a clean time series. By the end of this guide, you will be able to query, parse, and normalize Historical TTF Gas (symbol TTF_GAS) prices from the Energy API using a reproducible timeseries workflow that plugs directly into your finance stack.

What the TTF_GAS symbol represents and how it’s priced

TTF Gas (symbol code TTF_GAS) tracks the Title Transfer Facility benchmark used across European natural gas trading and risk management. The catalog unit for TTF_GAS is EUR/MWh. In finance contexts, you’ll often need consistent, timestamped values for backtesting strategies, calculating exposures, and benchmarking hedges against gas-linked contracts.

Illustration: Historical TTF Gas Prices

The Energy API provides this symbol via a single timeseries endpoint, returning values keyed by date alongside metadata describing the currency for each symbol. This separation is useful for robust currency-aware processing and downstream normalization in analytics pipelines.

Endpoint, auth, and request structure

Use the Energy API timeseries endpoint to retrieve TTF_GAS across a date range:

  • HTTP method: GET
  • Endpoint: /api/v1/timeseries
  • Query parameters:
    • start: inclusive start date (YYYY-MM-DD)
    • end: inclusive end date (YYYY-MM-DD)
    • symbols: one or more symbols, e.g., TTF_GAS
    • api_key: authentication (use YOUR_API_KEY only)

Authentication is via the api_key query parameter. Do not use other auth mechanisms here. Trial access is available (7 days / 50 calls), and starter plans begin at $19.99/mo.

Quick start: cURL you can copy-paste

Run this request to retrieve a time-bounded series for TTF_GAS. You can paste it into your terminal and substitute your key:

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

Understanding response fields you’ll actually use

This is the official sample JSON structure from the timeseries endpoint. Although the symbol shown here is OMIE_ES_DA (a different series), the field names, shapes, and semantics are the same for TTF_GAS. You will parse the same keys and map them to your finance model.

{
    "success": true,
    "date": "2026-10-31",
    "base": "EUR",
    "rates": {
        "OMIE_ES_DA": 208.9758
    },
    "dates": {
        "OMIE_ES_DA": "2026-10-31"
    },
    "currencies": {
        "OMIE_ES_DA": "EUR"
    },
    "base_filter_note": null,
    "missing_symbols": null
}

Field notes for finance integration:

  • success: boolean status of the call.
  • date: the server’s reference date for the response payload.
  • base: the default currency context (do not assume this equals the quote currency for all symbols).
  • rates: a map keyed by symbol; each value is the numeric quote for that symbol.
  • dates: per-symbol date (useful if the API returns mixed-asof data across symbols).
  • currencies: per-symbol currency code, which you should rely on when normalizing values into your portfolio’s reporting currency.
  • base_filter_note: informational, may help explain when symbols were filtered by base.
  • missing_symbols: list of any symbols not returned.

Real TTF_GAS response example for field mapping

The following is a real response snippet for TTF_GAS. Use these exact values to validate your deserialization and field mapping, then expand to full ranges in your application.

How to use it:

  • Read rates.TTF_GAS to get the numeric quote.
  • Read dates.TTF_GAS for the as-of date associated with this symbol.
  • Read currencies.TTF_GAS for the currency of the quote on that date.

Catalog unit for TTF_GAS is EUR/MWh, but quotes can be returned under different currency contexts depending on the base and symbol currency mapping in the response. Always use currencies.TTF_GAS to drive currency normalization before portfolio aggregation.

Python example: fetch, validate, and normalize for finance

This Python script calls the same endpoint, reads per-symbol fields, and demonstrates a normalization step you’ll likely need in finance workflows (e.g., converting to a reporting currency or enforcing a canonical unit). It assumes you will handle FX conversion externally using the currencies map in the response.

import os
import sys
import json
import datetime as dt
import urllib.parse
import urllib.request

API_URL = "https://energy-api.com/api/v1/timeseries"
API_KEY = "YOUR_API_KEY" # Replace with your key in runtime configuration

def fetch_ttf_timeseries(start_date, end_date):
params = {
"start": start_date,
"end": end_date,
"symbols": "TTF_GAS",
"api_key": API_KEY
}
url = f"{API_URL}?{urllib.parse.urlencode(params)}"
req = urllib.request.Request(url, method="GET")
with urllib.request.urlopen(req, timeout=30) as resp:
data = json.loads(resp.read().decode("utf-8"))
if not data.get("success", False):
raise RuntimeError("API call unsuccessful")
return data

def to_records(payload):
# Expecting: rates.TTF_GAS, dates.TTF_GAS, currencies.TTF_GAS
symbol = "TTF_GAS"
rates = payload.get("rates", {})
dates = payload.get("dates", {})
currencies = payload.get("currencies", {})

if symbol not in rates:
raise KeyError("TTF_GAS not found in rates")

# Some integrations receive a single date-value pair per request window.
# Extend here if the API returns multiple keyed by day in your plan.
value = rates[symbol]
asof = dates.get(symbol) or payload.get("date")
ccy = currencies.get(symbol) or payload.get("base")

if asof is None or ccy is None:
raise ValueError("Missing as-of date or currency for TTF_GAS")

# Build a normalized record; currency conversion is left to the caller.
return {
"symbol": symbol,
"as_of_date": asof, # "YYYY-MM-DD"
"price": float(value), # numeric quote
"currency": ccy, # per-symbol currency
"unit": "EUR/MWh" # catalog unit for TTF_GAS
}

def main():
start = "2026-01-01"
end = "2026-03-31"

payload = fetch_ttf_timeseries(start, end)
record = to_records(payload)

# Example: enforce a reporting currency decision using the currencies map.
# If record["currency"] != "EUR", route to your FX converter here before persistence.

print(json.dumps(record, indent=2))

if __name__ == "__main__":
try:
main()
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)

Finance-grade integration notes: units, currencies, time windows

Units and currency:

  • Catalog unit for TTF_GAS is EUR/MWh. Treat this as the physical measurement unit.
  • Quote currency can vary. Do not hardcode EUR; read currencies.TTF_GAS and normalize prices to your portfolio’s reporting currency before aggregation.
  • Do not pass base=USD when you also need TTF_GAS or EUA_CO2. If you need a specific currency view, rely on the per-symbol currencies map returned by the API and convert downstream.

Time handling:

  • The dates.TTF_GAS field provides the effective as-of date for that symbol. Use it for backtesting alignment and end-of-period PnL runs.
  • If you request a broad window, plan for non-trading days or non-publication days. Many energy datasets reflect market calendars with gaps; downstream logic should forward-fill consciously or exclude gaps depending on the finance calculation.

Caching and retries:

  • Cache stable historical windows to reduce both latency and call counts within your trial or plan limits (trial 7 days / 50 calls; Starter $19.99/mo).
  • Implement idempotent retries on transient network errors; do not mask API-level errors (check success and missing_symbols).

Schema details you will read on every call

To wire the API to a portfolio data model without surprises, consistently read these keys:

  • rates.TTF_GAS: the numeric price you’ll store or process.
  • dates.TTF_GAS: the as-of date for that price (string, YYYY-MM-DD).
  • currencies.TTF_GAS: the currency code for that price (e.g., EUR or USD).
  • base: a contextual currency returned with the response; do not rely on it for per-symbol currency—always check currencies for each symbol.
  • missing_symbols: if non-null, gracefully handle absent series in your pipeline (e.g., alert or skip).

Validation workflow for risk and backtesting

Before a model run or backtest, validate your TTF_GAS feed:

  • Presence checks: ensure TTF_GAS exists in rates, dates, and currencies.
  • Monotonic time keys: ensure dates are parseable and sorted chronologically in your data store.
  • Currency normalization: convert using currencies.TTF_GAS to your house currency before aggregations; record the conversion rate and timestamp in your audit log.
  • Unit consistency: TTF_GAS is EUR/MWh by catalog. If you maintain positions in MMBtu or therms, centralize unit conversion separately from currency conversion to prevent crossed assumptions.

Common pitfalls and how to avoid them

  • Hardcoding currency: never assume EUR. Always check currencies.TTF_GAS and normalize.
  • Ignoring as-of variance: when pulling multiple symbols, use dates.<symbol> for alignment rather than a single top-level date field.
  • Over-fetching: restrict date windows to what the job needs to stay within your plan’s call budget; cache immutable history aggressively.
  • Base conflicts: avoid forcing base=USD in queries when working with TTF_GAS; let the API return native mappings and normalize downstream.

Error handling patterns for production

When success is false or missing_symbols is non-null, branch to a controlled failure mode. For finance-grade jobs:

  • Log the full response for auditability.
  • Skip affected calculations and emit structured alerts with symbol and date window context.
  • Retry with exponential backoff only on network failures, not on deterministic schema errors.

Operational guidance and rollout

Roll out in two phases:

  • Phase 1: Implement one symbol (TTF_GAS) for a fixed historical window. Validate values, currency normalization, and unit conversions end to end in your warehouse or time-series DB.
  • Phase 2: Expand the window, automate schedules, and add risk checks (price jumps, stale data alerts). Maintain a small cache layer keyed by (symbol, date), invalidated daily or weekly based on your reporting cadence.

Cost control tips:

  • Batch windows by month or quarter in nightly jobs.
  • Persist raw payloads alongside parsed records to enable reprocessing without re-calling the API.
  • Use the trial (7 days / 50 calls) to validate schema mapping; then move to Starter ($19.99/mo) for automated jobs.

Reference: Official cURL and JSON

Use this official cURL for your baseline integration:

And the official JSON structure (field semantics apply equally to TTF_GAS):

FAQs

What unit are TTF_GAS values in?
The catalog unit is EUR/MWh. Treat this as the physical measurement unit for the series. Currency of the quote is provided per symbol in currencies.TTF_GAS.

Should I set a base currency in the request?
Avoid forcing base=USD when working with TTF_GAS (or EUA_CO2). Instead, read currencies.TTF_GAS from the response and perform any required currency conversion downstream in your finance layer.

How do I handle non-trading days?
Expect gaps on weekends or holidays depending on the market calendar. Choose a policy—forward fill for valuation continuity or gap-aware calculations for backtesting—and apply it consistently.

Can I request multiple symbols with TTF_GAS?
Yes, but always align results using dates.<symbol> for each symbol, since as-of dates may differ across series.

What are the trial and starter plan details?
Trial access is 7 days with 50 calls. The Starter plan is $19.99/month. Use caching and batch windows to stay within call budgets.

Register for API access and start integrating TTF_GAS into your finance workflows today. Create your key here: Register. For full parameter and schema references, see the Documentation.

Ready to get started?

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

Get API Key