DocsCommodities

Commodities REST endpoints

Indicative commodity references under /commodities: discovery, quotes, snapshots, and aggregates.

Authx-api-key headerBase path/commoditiesWebSocketcommodities.quotes, commodities.tradesSymbol formatCanonical codes & aliases (e.g. XAUUSD, WTIUSD)
Commodity endpoints provide indicative reference pricing for metals, energy, and agricultural markets. Responses use a consistent REST shape across supported symbols and accepted aliases. Sidebar Asset Classes entry: Commodities product docs (same contract).

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.

GET/commodities/symbols

Commodities symbol list

Canonical commodity symbols for the REST API. Aliases are accepted on quote/snapshot/aggregate routes but are not repeated in this list.

curl -sS "https://api.tickerlayer.com/commodities/symbols" \
  -H "x-api-key: <YOUR_API_KEY>"

Response 200 OK

JSON
{
  "symbols": [
    { "symbol": "BRENTUSD", "name": "Brent crude oil" },
    { "symbol": "CANOLAUSD", "name": "Canola / rapeseed" },
    { "symbol": "XAUUSD", "name": "Gold" },
    { "symbol": "WTIUSD", "name": "WTI crude oil" }
  ]
}
GET/commodities/quote/:symbol

Latest quote

Consolidated bid/ask and timestamp.

ParameterTypeDescription
symbolreqstringCanonical 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.
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

JSON
{
  "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.
GET/commodities/trade/last/:symbol

Last trade

Most recent trade-like price when present; otherwise a deterministic midpoint from the consolidated quote.

ParameterTypeDescription
symbolreqstringCanonical 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.
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

JSON
{
  "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.
GET/commodities/snapshot/:symbol

Market 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.

ParameterTypeDescription
symbolreqstringCanonical 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.
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

JSON
{
  "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.
GET/commodities/agg/:symbol/prev

Previous completed daily bar

Single most-recently completed UTC daily candle for the symbol.

ParameterTypeDescription
symbolreqstringCanonical 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.
ParameterTypeDescription
intervalstringOptional. 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.
curl -sS "https://api.tickerlayer.com/commodities/agg/XAUUSD/prev" \
  -H "x-api-key: <YOUR_API_KEY>"

Response 200 OK

JSON
{
  "symbol": "XAUUSD",
  "result": {
    "o": 2295.10,
    "h": 2325.40,
    "l": 2288.20,
    "c": 2318.42,
    "v": 0,
    "t": 1733011200000
  }
}
Returns 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.
GET/commodities/agg/:symbol/:multiplier/:timespan/:from/:to

Aggregates — OHLCV range

Historical bars between two UTC calendar dates. Same interval rules, date format, and pagination structure as other asset classes.

ParameterTypeDescription
symbolreqstringEnabled commodity symbol (e.g. XAUUSD, CORNUSD). Trimmed and uppercased before lookup.
multiplierreqnumberInterval multiplier. Valid pairs: 1, 5, 15 with minute; 1, 4 with hour; 1 with day.
timespanreqstringminute · hour · day — case-insensitive. Other values return 400.
fromreqstringUTC date start, inclusive. Format: YYYY-MM-DD.
toreqstringUTC date end, inclusive. Format: YYYY-MM-DD. Must be ≥ from.
ParameterTypeDescription
limitnumberPage size. Default 500, max 5000.
offsetnumberZero-based row offset applied after sort. Default 0.
sortstringSort bars by timestamp t before pagination. asc or desc (default desc).
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

JSON
{
  "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 is null when no volume is available for that bar, and 0 when the bar traded nothing.
  • Same supported intervals and max calendar windows as other aggregate routes.