Get latest price for a commodity
Changed onRetrieve the most recent price for a specific commodity or a comma-separated basket. The container-freight composite, Shanghai–Genoa and Shanghai–Los Angeles codes and their legacy DREWRY_WCI_* names resolve to the same stored series in a basket. Each group returns one quote, even when both names are requested. The returned code remains the actual stored code; requested_code and alias_of disclose a different requested name when the basket did not also request the served code. Missing groups are accounted for under the names requested, and stale data is not made fresh.
Request
- Base URLhttps://api.oilpriceapi.com
- AuthAPI key in header Authorization
Query parameters
Opt in to partial JSON results for multiple codes. Valid codes are returned in data.prices and rejected codes in data.missing with a reason. Requires an API key. All-invalid input remains 400; no available prices returns 404. The default and single-code responses are unchanged. Authentication, entitlements, quota and the 20-code cap still apply.
Commodity code or comma-separated commodity codes (defaults to BRENT_CRUDE_USD). Physical crude coverage includes MURBAN_CRUDE_USD, BONNY_LIGHT_USD, MARS_USD, LOUISIANA_LIGHT_USD, ESPO_CRUDE_USD, and JOHAN_SVERDRUP_USD.
These series have different publication cadences. Use as_of, data_status, stale, and freshness in the response rather than assuming the API collection time is the market date. Mars and LLS are monthly EIA first-purchase statistics and not live traded assessments; Johan Sverdrup is a quarterly-finalized tax-reference norm price; ESPO is an intermittent public snapshot.
Strict one-way aliases such as ASPHALT_USD to BITUMEN_USD resolve to their canonical series in single and multi-code requests. The returned code identifies the actual series. When a legacy alias is served by a different code, requested_code and alias_of disclose the mapping. A batch requesting both names returns one row for that canonical quote and does not list either as missing. BRENT_SPOT_EUROPE_USD is a dual-writer exception: it can serve its own newer observation of the same series instead of BRENT_SPOT_USD.
Price type
Response
Latest price data. A single by_code returns a flat data object (LatestPriceResponse); multiple comma-separated codes return data.prices[] (LatestPricesResponse).
Example response
{
"status": "success",
"data": {
"benchmark": {
"id": "nymex_wti_front_month",
"instrument_type": "front_month_futures",
"quote_type": "indicative_last_price",
"unit": "barrel",
"contract_month": "2026-12",
"roll_method": "explicit_contract_curve",
"roll_signal": "volume"
},
"price": 68.58,
"formatted": "$68.58",
"currency": "USD",
"code": "WTI_USD",
"requested_code": "ASPHALT_USD",
"alias_of": "BITUMEN_USD",
"contract_month": "2026-12",
"created_at": "2026-07-03T13:43:01.099Z",
"updated_at": "2026-07-03T13:43:01.099Z",
"type": "spot_price",
"unit": "barrel",
"source": "market_reporting",
"observed_at": "2026-07-13T12:00:00.000Z",
"source_date": "2026-07-13",
"as_of": "2026-07-13T12:00:00.000Z",
"collected_at": "2026-07-15T21:00:00.000Z",
"ingested_at": "2026-07-15T21:00:00.000Z",
"age_days": 2,
"price_type": "spot_price",
"data_status": "current",
"freshness": {
"status": "current",
"age_seconds": 275,
"expected_max_age_seconds": 1800
},
"changes": {
"24h": {
"amount": 0.72,
"percent": 1.06,
"previous_price": 67.86
},
"7d": {
"amount": 0.72,
"percent": 1.06,
"previous_price": 67.86
},
"30d": {
"amount": 0.72,
"percent": 1.06,
"previous_price": 67.86
},
"90d": {
"amount": 0.72,
"percent": 1.06,
"previous_price": 67.86
}
},
"metadata": {
"source": "market_reporting",
"source_description": "Aggregated from published market sources"
}
}
}Changes
- info
added the optional property
/////////to the response with the status - info
added the optional property
/////////to the response with the status - info
added the optional property
///////to the response with the status - info
added the optional property
///////to the response with the status
- info
- breaking
the response property
/////////became nullable for the status - breaking
the response property
///////became nullable for the status - info
added the optional property
/////////to the response with the status - info
added the optional property
/////////to the response with the status - info
added the optional property
/////////to the response with the status - info
added the optional property
///////to the response with the status - info
added the optional property
///////to the response with the status - info
added the optional property
///////to the response with the status
- breaking