Commodities
Indicative reference prices for precious and industrial metals, energy benchmarks, and agricultural contracts—normalized for dashboards, research tooling, and cross-asset displays. Not a claim about physical delivery, warehouse stocks, or venue-listed futures.
Commodity routes follow the same REST patterns as other asset classes where coverage is enabled for your key.
Overview
Commodity coverage is organized into three groups: metals, energy, and agriculture. Each symbol encodes a reference pair or contract-style identifier (typically against USD) suitable for application development, analytics, and indicative displays.
Data is consolidated and indicative—it may differ materially from any single venue or official settlement print. Use snapshots for a combined latest view, aggregates for historical context, and the quote endpoint for the latest consolidated bid/ask view when available.
Symbol groups
Metals
Precious and industrial metals vs USD.
Energy
Oil and gas benchmarks.
Agriculture
Grains and softs. SUGARUSD values are cents per pound.
/commodities/quote/:symbolLatest quote
Bid, ask, and consolidated price from the aggregated commodity quote view when present. Timestamps are Unix milliseconds.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Enabled commodity symbol (e.g. XAUUSD, WTIUSD). Trimmed and uppercased before lookup. Discover tickers with GET /commodities/symbols. |
Request
curl -sS "https://api.tickerlayer.com/commodities/quote/XAUUSD" \
-H "x-api-key: <YOUR_API_KEY>"Send runs against the live API with your account key (never exposed in the browser).
Response 200 OK
{
"symbol": "XAUUSD",
"price": 2318.42,
"bid": 2318.10,
"ask": 2318.74,
"timestamp": 1743512400000
}GET /commodities/quote/WTIUSD returns the same keys with values scaled for the instrument—for example "price": 82.41, "bid": 82.38, "ask": 82.45. 404 unknown symbol when the symbol is not enabled for your key./commodities/trade/last/:symbolLast trade
Most recent trade-like price for the symbol when present; otherwise a deterministic midpoint derived from the consolidated quote. Timestamps are Unix milliseconds.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Enabled commodity symbol (e.g. XAUUSD, WTIUSD). Trimmed and uppercased before lookup. Discover tickers with GET /commodities/symbols. |
Request
curl -sS "https://api.tickerlayer.com/commodities/trade/last/XAUUSD" \
-H "x-api-key: <YOUR_API_KEY>"Send runs against the live API with your account key (never exposed in the browser).
Response 200 OK
{
"symbol": "XAUUSD",
"price": 2318.42,
"size": 42,
"timestamp": 1743512400000
}GET /commodities/trade/last/WTIUSD returns the same keys with values scaled for the instrument. 404 unknown symbol when the symbol is not enabled for your key; 404 no fresh trade available when no quote can be resolved./commodities/snapshot/:symbolMarket snapshot
Combined bid/ask, last price, previous daily close, and derived change metrics in one normalized commodity snapshot.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Enabled commodity symbol (e.g. XAUUSD, WTIUSD). Trimmed and uppercased before lookup. Discover tickers with GET /commodities/symbols. |
Request
curl -sS "https://api.tickerlayer.com/commodities/snapshot/WTIUSD" \
-H "x-api-key: <YOUR_API_KEY>"Send runs against the live API with your account key (never exposed in the browser).
Response 200 OK
{
"symbol": "WTIUSD",
"bid": 71.22,
"ask": 71.25,
"bid_size": 58,
"ask_size": 55,
"last_price": 71.235,
"last_timestamp": 1743512400000,
"prev_close": 70.90,
"change": 0.335,
"change_percent": 0.472
}last_size appears when a trade size is available in the consolidated snapshot; otherwise it is omitted from the payload. change_percent is null when prev_close is zero or unavailable. An all-null snapshot returns 404./commodities/agg/:symbol/:multiplier/:timespan/:from/:toAggregates — OHLCV range
Historical bars between two UTC calendar dates. Same interval rules and pagination as other asset classes.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Enabled commodity symbol (e.g. XAUUSD, CORNUSD). Trimmed and uppercased before lookup. |
| multiplierreq | number | Interval multiplier. Valid pairs: 1, 5, 15 with minute; 1, 4 with hour; 1 with day. |
| timespanreq | string | minute · hour · day — case-insensitive. Other values return 400. |
| fromreq | string | UTC date start, inclusive. Format: YYYY-MM-DD. |
| toreq | string | UTC date end, inclusive. Format: YYYY-MM-DD. Must be ≥ from. |
Query parameters
| Parameter | Type | Description |
|---|---|---|
| limit | number | Page size. Default 500, max 5000. |
| offset | number | Zero-based row offset applied after sort. Default 0. |
| sort | string | Sort bars by timestamp t before pagination. asc or desc (default desc). |
Request
curl -sS "https://api.tickerlayer.com/commodities/agg/XAUUSD/1/day/2025-11-01/2025-11-30?sort=desc&limit=2" \
-H "x-api-key: <YOUR_API_KEY>"Response 200 OK
{
"symbol": "XAUUSD",
"results_count": 2,
"results": [
{ "o": 2295.10, "h": 2325.40, "l": 2288.20, "c": 2318.42, "v": 0, "t": 1733011200000 },
{ "o": 2270.50, "h": 2305.00, "l": 2265.00, "c": 2295.10, "v": 0, "t": 1732924800000 }
],
"next_offset": 2
}- Energy and agriculture bars use the same schema; volume may be
0ornullwhen not published for that interval. - Valid pairs: 1, 5, 15 /
minute; 1, 4 /hour; 1 /day.
/commodities/agg/:symbol/prevPrevious completed daily bar
Single most-recently completed UTC daily candle for the symbol.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Enabled commodity symbol (e.g. XAUUSD, WTIUSD). Trimmed and uppercased before lookup. Discover tickers with GET /commodities/symbols. |
Query parameters
| Parameter | Type | Description |
|---|---|---|
| interval | string | Optional. 1m · 5m · 15m · 1h · 4h · 1d. Returns the most recently settled bar at that interval instead of the previous daily bar, and adds interval, bar_start, bar_end and as_of to the response. Omit for the daily bar. |
Request
curl -sS "https://api.tickerlayer.com/commodities/agg/XAUUSD/prev" \
-H "x-api-key: <YOUR_API_KEY>"Response 200 OK
{
"symbol": "XAUUSD",
"result": {
"o": 2295.10,
"h": 2325.40,
"l": 2288.20,
"c": 2318.42,
"v": 0,
"t": 1733011200000
}
}404 no bar available when the daily bar cannot be resolved yet. Pass ?interval= (1m, 5m, 15m, 1h, 4h, 1d) for the most recently settled bar at that interval instead; the response then also carries interval, bar_start, bar_end and as_of. While the market is closed the last real bar is returned, still labelled with its own bar_start.WebSocket Streaming
Stream live quotes and trades for this asset class over the public WebSocket.
wss://stream.tickerlayer.com/?apiKey=<YOUR_API_KEY>Available channels
Subscribe example
After the connection is ready, send a JSON text frame:
{
"action": "subscribe",
"channels": [
"commodities.quotes",
"commodities.trades"
],
"symbols": [
"XAUUSD",
"WTIUSD"
]
}Example message
{
"type": "quote",
"channel": "commodities.quotes",
"asset": "commodities",
"symbol": "XAUUSD",
"bid": 2318.1,
"ask": 2318.74,
"bid_size": 58,
"ask_size": 48,
"ts": 1743512400000,
"timestamp": 1743512400000
}General WebSocket documentation
For authentication, subscribe/unsubscribe lifecycle, errors, limits, and heartbeats, see the WebSocket overview and Subscriptions.