Commodities REST endpoints
Indicative commodity references under /commodities: discovery, quotes, snapshots, and aggregates.
Symbol coverage
Canonical examples include XAUUSD, XAGUSD, WTIUSD, BRENTUSD, NGASUSD, COPPERUSD, and SUGARUSD. SUGARUSD public values use cents per pound (not dollars). Accepted aliases map to canonical codes—for example USOILUSD and CL1 to WTIUSD; XBRUSD and BZUSD to BRENTUSD; HG1 to COPPERUSD. GET /commodities/symbols returns canonical symbols; quote and aggregate routes accept aliases where configured.
/commodities/symbolsCommodities symbol list
Canonical commodity symbols for the REST API. Aliases are accepted on quote/snapshot/aggregate routes but are not repeated in this list.
Request
curl -sS "https://api.tickerlayer.com/commodities/symbols" \
-H "x-api-key: <YOUR_API_KEY>"Response 200 OK
{
"symbols": [
{ "symbol": "BRENTUSD", "name": "Brent crude oil" },
{ "symbol": "CANOLAUSD", "name": "Canola / rapeseed" },
{ "symbol": "XAUUSD", "name": "Gold" },
{ "symbol": "WTIUSD", "name": "WTI crude oil" }
]
}/commodities/quote/:symbolLatest quote
Consolidated bid/ask and timestamp.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Canonical code from GET /commodities/symbols, or an accepted alias that maps to a canonical symbol (trimmed and uppercased before lookup). Responses use the canonical symbol. |
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",
"bid": 2650.12,
"ask": 2650.45,
"bid_size": 72,
"ask_size": 68,
"timestamp": 1743512400000
}404 commodity symbol not supported when the code is not in the curated registry. 404 no quote available when no consolidated quote can be resolved. 503 service temporarily unavailable when data cannot be retrieved temporarily./commodities/trade/last/:symbolLast trade
Most recent trade-like price when present; otherwise a deterministic midpoint from the consolidated quote.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Canonical code from GET /commodities/symbols, or an accepted alias that maps to a canonical symbol (trimmed and uppercased before lookup). Responses use the canonical symbol. |
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": 2650.2,
"size": 42,
"timestamp": 1743512400000
}404 commodity symbol not supported when the code is not in the curated registry. 404 no fresh trade available when no quote can be resolved./commodities/snapshot/:symbolMarket snapshot
Combines latest quote fields with last completed daily close when available; includes optional change metrics. Includes last_size when a trade size is present in the consolidated snapshot.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Canonical code from GET /commodities/symbols, or an accepted alias that maps to a canonical symbol (trimmed and uppercased before lookup). Responses use the canonical symbol. |
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
}404 commodity symbol not supported or 404 no snapshot available when empty or unavailable./commodities/agg/:symbol/prevPrevious completed daily bar
Single most-recently completed UTC daily candle for the symbol.
Path parameters
| Parameter | Type | Description |
|---|---|---|
| symbolreq | string | Canonical code from GET /commodities/symbols, or an accepted alias that maps to a canonical symbol (trimmed and uppercased before lookup). Responses use the canonical symbol. |
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. With ?interval= the response is the most recently settled bar at that interval. The bar is held for a short settle lag after it closes, so the boundary sits away from the round minute and small clock differences between callers do not change which bar comes back. It is the same bar the historical range endpoint returns for that window, so an audit can re-fetch that exact window and compare against the same source. The response then also carries interval, bar_start, bar_end and as_of, and Cache-Control plus ETag mark exactly when the value can next change. While the market is closed the last real bar is returned, still labelled with its own bar_start./commodities/agg/:symbol/:multiplier/:timespan/:from/:toAggregates — OHLCV range
Historical bars between two UTC calendar dates. Same interval rules, date format, and pagination structure 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": null, "t": 1732924800000 }
],
"next_offset": 2
}vis the aggregated volume for the bar. For energy, copper and the agricultural contracts it is the front-month futures contract's exchange volume over the bar's span; for the metals it comes from the aggregation layer. It isnullwhen no volume is available for that bar, and0when the bar traded nothing.- Same supported intervals and max calendar windows as other aggregate routes.