Henry Hub (HENRY_HUB) Price API

Henry Hub (HENRY_HUB) Price API

You need a reliable way to fetch the latest Henry Hub natural gas benchmark price and wire it directly into your finance stack. By the end of this guide, you will be able to query the Energy API for HENRY_HUB, validate units and dates, parse its JSON response, and ship production-grade code that updates dashboards, models, and alerts.

What you’ll build and the data you’ll read

This article focuses on a single Finance symbol: Henry Hub (HENRY_HUB). You will call a latest-price endpoint, read the current quote, confirm its currency and unit, and align the date for accounting, risk, and settlement operations. You will:

Illustration: Henry Hub (HENRY_HUB) Price API
  • Call GET https://energy-api.com/api/v1/latest with symbols=HENRY_HUB and api_key.
  • Parse rates.HENRY_HUB (the numeric price), dates.HENRY_HUB (the price date), and currencies.HENRY_HUB (the currency code).
  • Respect units: USD/MMBtu.
  • Implement safe handling for base and symbol mixing (if you add other energy symbols later).

Origin catalog facts (for HENRY_HUB)

  • Symbol name: Henry Hub
  • Symbol code: HENRY_HUB
  • Unit: USD/MMBtu
  • Auth: api_key query parameter. Placeholder YOUR_API_KEY only.
  • Do not pass base=USD when you also need TTF_GAS or EUA_CO2.
  • No MCP host. Starter $19.99/mo, trial 7 days / 50 calls.
  • curl: curl -G "https://energy-api.com/api/v1/latest" --data-urlencode "symbols=HENRY_HUB" --data-urlencode "api_key=YOUR_API_KEY"
  • Read rates.HENRY_HUB, dates.HENRY_HUB, currencies.HENRY_HUB. base may be MIXED.

How to call the latest endpoint for Henry Hub

Use a GET request with query parameters: symbols and api_key. For a single-symbol call to HENRY_HUB, you do not need a base parameter.

curl -G "https://energy-api.com/api/v1/latest" --data-urlencode "symbols=HENRY_HUB" --data-urlencode "api_key=YOUR_API_KEY"

Notes:

  • Authentication is via api_key query parameter (YOUR_API_KEY placeholder shown). No headers or MCP host are used.
  • Keep the symbol exactly as HENRY_HUB.
  • If you later add TTF_GAS or EUA_CO2 to symbols, do not pass base=USD because the base may be MIXED in multi-symbol responses. For HENRY_HUB alone, base will be USD in the sample below.

Official JSON response examples

Here is the official response you should expect to parse for HENRY_HUB. Use these exact values in tests while wiring your code.

Example 1: Base request for HENRY_HUB

{
"success": true,
"date": "2026-10-27",
"base": "USD",
"rates": {
"HENRY_HUB": 2.76
},
"dates": {
"HENRY_HUB": "2026-10-27"
},
"currencies": {
"HENRY_HUB": "USD"
},
"base_filter_note": null,
"missing_symbols": null
}

Fields you will actually use:

  • rates.HENRY_HUB: The latest price (2.76).
  • currencies.HENRY_HUB: Currency for the symbol (USD).
  • dates.HENRY_HUB: The symbol-specific price date (2026-10-27).
  • date (top-level): Response-level date. For single-symbol latest calls, it will match the symbol date.
  • base: Currency base for the response (USD here). When mixing certain symbols, base may be MIXED.

Example 2: Repeat sample for integration tests (schema-identical)

{
"success": true,
"date": "2026-10-27",
"base": "USD",
"rates": {
"HENRY_HUB": 2.76
},
"dates": {
"HENRY_HUB": "2026-10-27"
},
"currencies": {
"HENRY_HUB": "USD"
},
"base_filter_note": null,
"missing_symbols": null
}

Use this identical block for contract tests that validate key paths (rates.HENRY_HUB, dates.HENRY_HUB, currencies.HENRY_HUB) without network calls.

Example 3: Repeat sample for cache and idempotency tests

{
"success": true,
"date": "2026-10-27",
"base": "USD",
"rates": {
"HENRY_HUB": 2.76
},
"dates": {
"HENRY_HUB": "2026-10-27"
},
"currencies": {
"HENRY_HUB": "USD"
},
"base_filter_note": null,
"missing_symbols": null
}

Use this block to verify that your service returns the same computed values for repeated latest requests within your cache TTL.

Parsing the response in Python

This Python example calls the same endpoint and extracts the finance-critical fields for Henry Hub: price, currency, and date. It also asserts unit assumptions (USD/MMBtu) based on the catalog facts above.

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

API_URL = "https://energy-api.com/api/v1/latest"
API_KEY = os.environ.get("ENERGY_API_KEY", "YOUR_API_KEY")
SYMBOL = "HENRY_HUB" # Henry Hub natural gas benchmark

def latest_henry_hub():
params = {
"symbols": SYMBOL,
"api_key": API_KEY
}
url = API_URL + "?" + urllib.parse.urlencode(params)
with urllib.request.urlopen(url, timeout=10) as resp:
body = resp.read().decode("utf-8")
data = json.loads(body)

if not data.get("success", False):
raise RuntimeError("Energy API returned success=false")

# Read required fields
price = data["rates"][SYMBOL]
price_date = data["dates"][SYMBOL]
currency = data["currencies"][SYMBOL]
base = data.get("base")

# Finance checks
if currency != "USD":
raise ValueError(f"Unexpected currency for {SYMBOL}: {currency}")
if base not in ("USD", "MIXED"):
raise ValueError(f"Unexpected base: {base}")

# Unit per catalog: USD/MMBtu (not a response field; document-driven expectation)
unit = "USD/MMBtu"

return {
"symbol": SYMBOL,
"price": price,
"price_date": price_date,
"currency": currency,
"unit": unit,
"base": base
}

if __name__ == "__main__":
try:
quote = latest_henry_hub()
print(json.dumps(quote, indent=2))
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)

Parsing the response in JavaScript

This Node.js example fetches the latest Henry Hub price and validates the key fields used in finance pipelines.

import https from "node:https";
import { URL } from "node:url";

const API_URL = "https://energy-api.com/api/v1/latest";
const API_KEY = process.env.ENERGY_API_KEY || "YOUR_API_KEY";
const SYMBOL = "HENRY_HUB";

function fetchJson(url) {
return new Promise((resolve, reject) => {
https.get(url, (res) => {
let data = "";
res.setEncoding("utf8");
res.on("data", (chunk) => (data += chunk));
res.on("end", () => {
try {
resolve(JSON.parse(data));
} catch (err) {
reject(err);
}
});
}).on("error", reject);
});
}

async function latestHenryHub() {
const u = new URL(API_URL);
u.searchParams.set("symbols", SYMBOL);
u.searchParams.set("api_key", API_KEY);

const data = await fetchJson(u.toString());

if (!data.success) {
throw new Error("Energy API returned success=false");
}

const price = data.rates[SYMBOL];
const priceDate = data.dates[SYMBOL];
const currency = data.currencies[SYMBOL];
const base = data.base;

if (currency !== "USD") {
throw new Error(`Unexpected currency for ${SYMBOL}: ${currency}`);
}
if (base !== "USD" && base !== "MIXED") {
throw new Error(`Unexpected base: ${base}`);
}

const unit = "USD/MMBtu"; // from catalog facts
return { symbol: SYMBOL, price, priceDate, currency, unit, base };
}

latestHenryHub()
.then((q) => console.log(JSON.stringify(q, null, 2)))
.catch((err) => {
console.error("Error:", err);
process.exit(1);
});

Field-by-field reference (for HENRY_HUB latest)

Field Path Type Meaning for finance workflows
Price rates.HENRY_HUB number Latest Henry Hub quote to feed PnL, VaR, or valuation models.
Symbol date dates.HENRY_HUB string (YYYY-MM-DD) Business date tied to the quote. Use for EOD alignment and backfilling.
Currency currencies.HENRY_HUB string Should be USD for HENRY_HUB. Combine with unit assumptions in your UI and reports.
Response date date string (YYYY-MM-DD) Response-level date; for single-symbol latest calls it mirrors the symbol date.
Base base string USD for this request. If you add certain symbols (e.g., TTF_GAS, EUA_CO2), base may be MIXED.
Success success boolean Quick gate for error handling; proceed only if true.
Missing symbols missing_symbols null or array Non-null indicates unavailable symbols; handle gracefully in multi-symbol calls.
Base filter note base_filter_note null or string Optional metadata about base filtering conditions if present.

Units, dates, base currency, and non-trading-day behavior

Unit: The catalog states USD/MMBtu for Henry Hub. This is not included as a field in the response, so enforce it in your client code and UI strings to avoid unit drift.

Date: Use dates.HENRY_HUB as your authoritative price date. It is formatted YYYY-MM-DD, suitable for database keys and end-of-day pipelines. The top-level date should match for this single-symbol call.

Base: For a call including only HENRY_HUB, base is USD. If you later add symbols like TTF_GAS or EUA_CO2, do not pass base=USD because the result may logically be MIXED. Your parser should accept base equal to USD or MIXED.

Non-trading days: Energy benchmarks may not update on weekends or holidays. If you see a prior business date in dates.HENRY_HUB, that is expected; design your cache and display rules to tolerate unchanged values across closures.

Caching, retries, and idempotency

  • Cache key: Combine endpoint and symbols parameter. Example: latest|HENRY_HUB.
  • Cache policy: If you refresh intraday, a short TTL (e.g., a few minutes) avoids redundant calls. For EOD workflows, refresh once per business day after your chosen cutover time.
  • Idempotency: Latest calls are safe to repeat; data won’t change more often than provider updates. Use the identical JSON samples above for offline snapshot tests.
  • Retries: Network retries with exponential backoff are appropriate. Always guard on success == true before trusting fields.

Pricing, authentication, and trial

Authentication is via api_key as a query parameter. Use the literal placeholder YOUR_API_KEY in code examples until you provision a real key. Plan details available from the catalog:

  • Starter is $19.99/mo.
  • Trial is 7 days / 50 calls.

There is no MCP host requirement. Keep your integration limited to the documented latest endpoint and parameters in this guide.

Common pitfalls and how to avoid them

  • Using base=USD in mixed portfolios: If you add TTF_GAS or EUA_CO2, do not pass base=USD. Parse base from the response and accept MIXED when present.
  • Forgetting to read symbol-scoped fields: Always read rates.HENRY_HUB, dates.HENRY_HUB, and currencies.HENRY_HUB. Do not rely solely on top-level date or base in multi-symbol scenarios.
  • Unit confusion in UIs: Hardcode and display “USD/MMBtu” alongside the price for Henry Hub to prevent misinterpretation.
  • Silent failures: Check success before using any numeric fields. Handle missing_symbols when you scale to multiple energy benchmarks.

End-to-end example workflow

This sequence aligns with typical finance data ingestion for a daily valuation run:

  1. At your daily cutover, call GET /api/v1/latest with symbols=HENRY_HUB and your api_key.
  2. Verify success == true; read rates.HENRY_HUB, dates.HENRY_HUB, currencies.HENRY_HUB, and base.
  3. Persist price with a composite key: symbol + dates.HENRY_HUB. Store currency and base as columns for auditability.
  4. Compute derived metrics (e.g., positions x price) using the USD/MMBtu unit convention.
  5. Cache the response JSON to reduce identical calls within your operating window.

Official documentation links

For additional parameters, schema notes, or updates, see the product docs and create an account to get your key:

FAQ

What unit should I show in my UI for HENRY_HUB?
USD/MMBtu, per the catalog facts. The response includes currency but not the unit string, so document and enforce the unit in your client code.

Do I need to pass base=USD?
No. For HENRY_HUB alone, the response base is USD. If you add symbols like TTF_GAS or EUA_CO2, do not pass base=USD, and be prepared for base to be MIXED.

Which fields should I persist for finance auditability?
Persist symbol, rates.HENRY_HUB (price), dates.HENRY_HUB (price date), currencies.HENRY_HUB (currency), base, and the raw JSON for lineage.

How do I detect missing data?
Check success first. Then inspect missing_symbols (non-null indicates unavailable entries in multi-symbol queries). For single-symbol HENRY_HUB, you should not see missing_symbols unless there is an outage.

How often does the latest price change?
This guide does not specify update frequency. Use short caching for intraday refresh and rely on dates.HENRY_HUB to confirm when a new value has posted.

If you are ready to wire Henry Hub into your finance models and dashboards, create an account and get your API key, then follow the endpoint details in the docs: Register and read the Documentation.

Ready to get started?

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

Get API Key

Related posts