Historical Brent Crude Prices
You need a reliable way to pull and process historical Brent crude oil prices for finance workflows like PnL attribution, hedge backtesting, or pricing curves. By the end of this guide, you will know exactly how to query the Energy API timeseries endpoint for the Brent Crude symbol, interpret the response fields that matter, handle the current catalog error gracefully, and build a resilient parser you can drop into production.
What you will build and how to use it
This post walks through a concrete integration plan around the Energy API’s timeseries endpoint for the Brent Crude symbol (code BRENT_CRUDE). You will get:
- A copy-paste cURL request to query time-bounded Brent prices.
- A Python example that calls the same endpoint and reads only the fields you need for pricing workflows.
- Three complete JSON responses to test parsing logic, including the real BRENT_CRUDE availability error.
- Operational notes for units, currencies, dates, and error handling so your finance jobs don’t break mid-run.
Symbol facts you must rely on
These catalog facts apply to Brent Crude in the Energy API:
- Symbol name: Brent Crude
- Symbol code: BRENT_CRUDE
- Unit: USD/barrel
- Authentication: api_key query parameter (use YOUR_API_KEY only)
- Endpoint: GET /api/v1/timeseries with query params start, end, symbols, and api_key
- Plans: Starter $19.99/mo, 7-day trial with 50 calls
- Do not pass base=USD when you also need other symbols like TTF_GAS or EUA_CO2 in the same call
The response relevant to finance use cases will include:
- rates.BRENT_CRUDE: the price series values in the requested window
- currencies.BRENT_CRUDE: the currency code for those values (for Brent, that is USD)
Endpoint and query shape for historical Brent prices
The timeseries endpoint lets you ask for historical prices within a specified start and end date range. It also accepts multiple symbols, but if you only need Brent, pass BRENT_CRUDE alone. Keep your job design simple by batching calls predictably (for example, month-by-month) and caching stable windows after settlement.
HTTP method: GET
Path: /api/v1/timeseries
Query parameters:
- start: inclusive date boundary (YYYY-MM-DD)
- end: inclusive date boundary (YYYY-MM-DD)
- symbols: comma-separated list of one or more symbol codes (BRENT_CRUDE)
- api_key: your API key as a query parameter (value: YOUR_API_KEY)
Copy-paste cURL request
Use this exact call to request a window for BRENT_CRUDE. Replace YOUR_API_KEY with your actual 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=BRENT_CRUDE" --data-urlencode "api_key=YOUR_API_KEY"
Official JSON sample to validate your parser
The following is an official sample payload for the same endpoint. It proves field names and top-level structure. Note: this example carries a different symbol (OMIE_ES_DA) and base EUR; keep your parser generic and do not hardcode fields to any one symbol or currency.
{
"success": true,
"date": "2026-11-12",
"base": "EUR",
"rates": {
"OMIE_ES_DA": 116.1602
},
"dates": {
"OMIE_ES_DA": "2026-11-12"
},
"currencies": {
"OMIE_ES_DA": "EUR"
},
"base_filter_note": null,
"missing_symbols": null
}
Fields you will actually use:
- success: boolean indicating whether the request was processed successfully.
- rates: dictionary keyed by symbol, containing the value(s) for your window.
- dates: per-symbol date attribution, which you can join to rates for valuation time alignment.
- currencies: per-symbol currency code; for Brent, expect USD.
Current real response for BRENT_CRUDE and how to handle it
The live call at the time of writing returned the following error payload for BRENT_CRUDE. Do not attempt to infer or fabricate price values when you receive this—propagate the error to your logs and fail fast or degrade gracefully in downstream finance calculations.
{"success":false,"error":"Symbol BRENT_CRUDE is not currently available. See \/api\/v1\/symbols for the current catalog."}
What to do in your code:
- If success is false, skip valuation for BRENT_CRUDE in that run and alert on catalog drift.
- Keep your integration source-of-truth for symbol availability in sync with the catalog endpoint referenced in the error.
- Do not patch in external or manual prices; that breaks reproducibility of finance analyses.
Use the official sample response as a parsing fixture
Until BRENT_CRUDE is available again, you can unit test your parser using the official sample structure below. It is the same sample shown earlier, included here so you can copy it into a test fixture without scrolling.
{
"success": true,
"date": "2026-11-12",
"base": "EUR",
"rates": {
"OMIE_ES_DA": 116.1602
},
"dates": {
"OMIE_ES_DA": "2026-11-12"
},
"currencies": {
"OMIE_ES_DA": "EUR"
},
"base_filter_note": null,
"missing_symbols": null
}
This lets you confirm your code navigates success, rates, dates, and currencies consistently, even when the symbol of interest (BRENT_CRUDE) is temporarily unavailable.
Python: request, validate, and normalize Brent prices
The Python example below calls the same endpoint, enforces a success check, and then extracts fields only if BRENT_CRUDE is present. It also preserves units (USD/barrel) in the output so your finance layer downstream can price inventory, hedges, or swaps without ambiguity.
import os
import sys
import json
import urllib.parse
import urllib.request
BASE_URL = "https://energy-api.com/api/v1/timeseries"
API_KEY = os.environ.get("ENERGY_API_KEY", "YOUR_API_KEY")
def fetch_timeseries(start, end, symbols):
params = {
"start": start,
"end": end,
"symbols": ",".join(symbols),
"api_key": API_KEY,
}
url = BASE_URL + "?" + urllib.parse.urlencode(params)
req = urllib.request.Request(url)
with urllib.request.urlopen(req, timeout=30) as resp:
body = resp.read().decode("utf-8")
return json.loads(body)
def extract_brent(payload):
# Validate success flag first
if not payload or not isinstance(payload, dict):
raise ValueError("Empty or invalid JSON payload")
if not payload.get("success"):
# Bubble the exact error up for logging/alerting
raise RuntimeError(payload.get("error", "Unknown error"))
# Safely dereference container fields
rates = payload.get("rates") or {}
currencies = payload.get("currencies") or {}
dates = payload.get("dates") or {}
# Expect Brent fields if the symbol was requested and available
symbol = "BRENT_CRUDE"
if symbol not in rates:
raise KeyError(f"{symbol} not found in rates")
price = rates[symbol]
currency = currencies.get(symbol)
asof = dates.get(symbol)
# Enforce unit awareness for finance calculations
unit = "USD/barrel" # Catalog fact for BRENT_CRUDE
return {
"symbol": symbol,
"asof": asof,
"price": price,
"currency": currency,
"unit": unit,
}
if __name__ == "__main__":
start = "2026-01-01"
end = "2026-03-31"
symbols = ["BRENT_CRUDE"]
try:
data = fetch_timeseries(start, end, symbols)
record = extract_brent(data)
print(json.dumps(record, indent=2))
except Exception as e:
# Print the exact error so schedulers/monitors catch catalog mismatches
print(f"ERROR: {e}", file=sys.stderr)
sys.exit(1)
Notes for production:
- Keep YOUR_API_KEY only in code samples. In production, pass your real key via environment variable or secret manager.
- If you expand symbols, do not add base=USD alongside other symbols like TTF_GAS or EUA_CO2 in the same call.
- Normalize the output schema (symbol, asof, price, currency, unit) before storing in your finance datastore.
Reading and joining fields for finance-grade timeseries
For historical valuations, you should align on the date field emitted for each symbol. Use dates.BRENT_CRUDE as your as-of attribute for joins, not the top-level date if the API provides per-symbol dates. Always couple a price point with its currency and unit so downstream mark-to-market logic doesn’t silently assume the wrong denomination.
- Price: rates.BRENT_CRUDE
- As-of: dates.BRENT_CRUDE
- Currency: currencies.BRENT_CRUDE (for Brent, USD)
- Unit: USD/barrel (catalog fact)
Error handling and resilience
When success is false, do not synthesize prices. Finance systems should fail fast or skip the impacted symbol and emit a clear alert. The real BRENT_CRUDE response at the time of writing is shown again for convenience:
{"success":false,"error":"Symbol BRENT_CRUDE is not currently available. See \/api\/v1\/symbols for the current catalog."}
Recommended actions:
- Alert on catalog errors and surface the message to your runbook.
- Make symbol lists configurable so you can remove or re-add BRENT_CRUDE without code changes.
- Cache past-settled windows; historical values for completed days rarely change and can be safely reused.
Time windows, settlement, and non-trading days
Energy commodities may have days without prints or with settlement timing differences. Design your loader to:
- Request a stable batch window (for example, month-to-date) and cache completed days.
- Handle gaps: missing days should not break your ETL; forward-fill only if your finance policy explicitly allows it.
- Re-run small backfills when the catalog changes to pick up any retroactive corrections.
Validation tips that save time
Small checks prevent silent data drift in finance workflows:
- Assert currencies.BRENT_CRUDE equals USD before storing values.
- Assert unit equals USD/barrel in your schema registry or metadata store.
- Record the exact request window and symbol list in audit logs to make PnL reproducible.
Change management for symbol availability
Symbols can enter or leave the catalog. Your job should validate availability before attempting a bulk backfill. If BRENT_CRUDE is unavailable, skip backfills and log a ticket to re-run when it returns. For CI, keep a pinned JSON sample (like the official sample above) to ensure parser tests remain green even when live calls fail.
Frequently asked questions
What symbol code should I use for Brent crude oil?
Use BRENT_CRUDE. Do not alias or invent alternative names.
What are the units and currency for Brent prices?
USD/barrel, with currencies.BRENT_CRUDE returning USD.
How do I authenticate?
Pass your key using the api_key query parameter. In code samples here, use the literal YOUR_API_KEY placeholder only.
Why am I seeing an error for BRENT_CRUDE?
The current live response indicates BRENT_CRUDE is not available. Respect the error and avoid fabricating values. Monitor the catalog and re-enable the symbol when it returns.
Can I query multiple symbols at once?
Yes, pass a comma-separated list to symbols. Do not pass base=USD if you also include symbols like TTF_GAS or EUA_CO2 in the same request.
Next step
Set up your account and run the sample request now. Create an API key with the 7-day, 50-call trial, wire the Python snippet into your job, and keep the unit and currency checks in place for finance-grade data hygiene. When you are ready, register here: Register. For endpoint and field references, see the Documentation.
Ready to get started?
Get your API key and start querying energy commodity prices in minutes.
Get API Key