Real-time and historical reference prices for the Gas Oil (diesel/heating oil) futures contract.
| Method | Endpoint | Description |
|---|
| GET | /v1/futures/ice-gasoil | Current contract prices |
| GET | /v1/futures/ice-gasoil/historical | Historical data |
| GET | /v1/futures/ice-gasoil/ohlc | Daily OHLC |
| GET | /v1/futures/ice-gasoil/intraday | 5-minute intervals |
| GET | /v1/futures/ice-gasoil/spreads | Calendar spreads |
| GET | /v1/futures/ice-gasoil/curve | Futures curve |
| GET | /v1/futures/ice-gasoil/spread-history | Spread history |
by_code=GASOIL_FUTURES on /v1/prices/latest (and the other /v1/prices/* endpoints) resolves to the current front-month contract — verified live 2026-09-11, it returned "code": "GASOIL_FUTURES_2026_10". Use it when you want the rolling front-month price without tracking contract expiry yourself.
GET /v1/futures/ice-gasoil
{
"commodity": "GASOIL_FUTURES",
"source": "market_reporting",
"updated_at": "2025-12-29T14:30:00.000Z",
"trading_hours": "01:00-23:00 GMT",
"contracts": [
{
"contract_month": "2026-01",
"last_price": 685.50,
"currency": "USD",
"unit": "metric_ton",
"open": 683.25,
"close": 685.00,
"high": 687.75,
"low": 682.50,
"volume": 45678,
"change_percent": 0.29,
"days_to_expiry": 6,
"contract_status": "near_expiry",
"is_front_month": false,
"is_nearest_contract": true,
"expiry_date": "2026-01-12",
"open_interest": 87654
}
],
"metadata": {
"total_contracts": 12,
"data_source": "market_reporting",
"front_month_contract": "2026-02",
"nearest_contract_month": "2026-01",
"front_month_selection": {
"method": "roll_warning_days",
"roll_warning_days": 7,
"nearest_contract": "2026-01",
"nearest_days_to_expiry": 6,
"front_month_contract": "2026-02",
"rolled": true,
"reason": "nearest contract 2026-01 is within 7 days of its last trading day (6 days remaining), so front_month has rolled to 2026-02; 2026-01 continues to trade until its expiry_date"
}
}
}
| Field | Type | Description |
|---|
days_to_expiry | integer | Days until contract expires |
contract_status | string | front_month, near_expiry, active, or expired |
is_front_month | boolean | Whether this is the primary trading contract. Rolls to the next contract 7 days before the current one's last trading day. |
is_nearest_contract | boolean | Whether this is the nearest contract still trading, held through its last trading day. Use this, with days_to_expiry and expiry_date, to apply your own roll rule. |
expiry_date | date | Calculated expiry date (ISO 8601) |
open_interest | integer | Open interest (when available) |
ICE Gas Oil contracts stop trading two London business days before the 14th of the delivery month.
The top-level nearest_contract object and metadata.front_month_selection show, side by side, the contract still trading and the contract front_month has rolled to. See Front month vs. nearest contract.
GET /v1/futures/ice-gasoil/historical
| Parameter | Type | Default | Description |
|---|
from | date | 30 days ago | Start date |
to | date | today | End date |
contracts | string | all | Contract months |
format | string | json | json or csv |
GET /v1/futures/ice-gasoil/ohlc
| Parameter | Type | Default | Description |
|---|
days | integer | 30 | Period (1-1825). Larger values are served as 1825 with truncated: true, days_requested, and days_served in the response |
contract | string | front month | Contract month |
GET /v1/futures/ice-gasoil/intraday
| Parameter | Type | Default | Description |
|---|
date | date | today | Trading date |
contract | string | front month | Contract month |
GET /v1/futures/ice-gasoil/spreads
| Parameter | Type | Default | Description |
|---|
pairs | string | consecutive | Spread pairs |
days | integer | 30 | Analysis period |
GET /v1/futures/ice-gasoil/curve
| Parameter | Type | Default | Description |
|---|
date | date | today | Analysis date |
GET /v1/futures/ice-gasoil/spread-history
| Parameter | Type | Required | Description |
|---|
front_contract | string | Yes | Front contract |
back_contract | string | Yes | Back contract |
days | integer | No | History period |
import requests
response = requests.get(
"https://api.oilpriceapi.com/v1/futures/ice-gasoil",
headers={"Authorization": "Token YOUR_API_KEY"}
)
data = response.json()
print(f"Gas Oil Front Month: ${data['contracts'][0]['last_price']}/MT")
Gasoil has strict live-freshness semantics: when ICE is open and intraday data falls behind the market-hours freshness bound, the API returns 503 LIVE_DATA_STALE (with the market-hours context in the body) instead of serving stale ticks — this applies to the family-latest and /intraday endpoints. A refresh is normally triggered automatically; retry after a few minutes. Outside market hours the last session's data is served as usual, subject to the 96-hour bound. See the futures error table.