GET
/v1/hist/commodities/:symbol/barsgzip requiredCommodities bars
Paginated OHLCV bars for a commodity, from 1-minute through 1-hour. Each bar carries t (Unix epoch milliseconds, UTC, marking the bucket's open time), o/h/l/c as float prices, and v as the tick-count for the bucket. Commodities quote against USD on a rolling near-24/7 calendar, so all time inputs are read as UTC.
Parameters
ParameterDescription
Parameter
symbolrequiredstring · path- Commodity code, 4–12 uppercase alphanumerics. e.g. XAUUSD (gold), XAGUSD (silver), XPTUSD (platinum), XPDUSD (palladium). Case-insensitive. Symbols outside the supported set return 404.
startrequiredstring · query- Inclusive lower bound on bar time. Required on the first page; cursor overrides on subsequent pages. Accepts YYYY-MM-DD (midnight UTC) or full RFC3339 (2026-05-01T00:00:00Z).
endstring · query- Inclusive upper bound on bar time. Same shape as start. Defaults to now. Must be strictly after start.
intervalstring · query- Bar size. One of: 1m, 5m, 15m, 30m, 1h. Default 1m, honored exactly. Same enum as /hist/stocks, /hist/forex, and /hist/crypto so a single client schema works across asset classes.
limitinteger · query- Bars per page. Default 1000, max 2000.
cursorstring · query- Pagination token. Opaque. Pass back the value of meta.next_cursor from the previous response verbatim. When present, overrides start. Subsequent pages need no other parameters; the cursor encodes the next start.
Example
request · shell
# First page, hourly gold barscurl -H "X-API-Key: $KEY" -H "Accept-Encoding: gzip" --compressed \ "https://api.sifting.io/v1/hist/commodities/XAUUSD/bars?start=2026-05-01&end=2026-05-02&interval=1h&limit=24" # Subsequent page, drop start and pass cursorcurl -H "X-API-Key: $KEY" -H "Accept-Encoding: gzip" --compressed \ "https://api.sifting.io/v1/hist/commodities/XAUUSD/bars?cursor=MTc4MTU2ODI0MQ&interval=1m&limit=2000"200OKapplication/json (gzip)
{ "data": [ { "t": 1781568000000, "o": 4339.35, "h": 4339.94, "l": 4338.50, "c": 4338.58, "v": 21 } ], "meta": { "symbol": "XAUUSD", "interval": "1m", "as_of": "2026-06-18T11:26:51Z", "next_cursor": "MTc4MTU2ODI0MQ" }}Loading runner…
First load onlyReference
Per-bar fieldsDescription
Per-bar fields
- t
- Bar open time, Unix epoch milliseconds, UTC. The bar covers [t, t + interval).
- o, h, l, c
- Open, high, low, and close prices for the bucket, USD.
- v
- Tick-count volume: the number of price updates in the bucket.
- meta.next_cursor
- Present only when the page came back full and more data exists before end; absent at the tail.
Pagination patternDescription
Pagination pattern
- First call
- ?start=2026-05-01&interval=1m&limit=2000
- Next call
- If meta.next_cursor is present, call again with ?cursor=<token>. interval and limit are sticky by convention.
- Tail
- Repeat until meta.next_cursor is absent. A short page is the end-of-data signal.
Error responses
StatusCodeMeaning
- 404
not_foundSymbol outside our coverage.
{ "error": "not_found", "message": "Symbol not found."} - 400
invalid_parameterMalformed symbol, interval, start, end, limit, or cursor.
{ "error": "invalid_parameter", "message": "start must be YYYY-MM-DD or RFC3339."} - 403
forbiddenKey is valid but the plan lacks commodities access.
{ "error": "forbidden", "message": "Plan does not include the commodities market."} - 406
gzip_requiredHeavy endpoint called without Accept-Encoding: gzip.
{ "error": "gzip_required" } - 503
historical_unavailableCommodities historical data is not configured on this deployment.
{ "error": "historical_unavailable" } - 503
upstream_rate_limitedOur aggregation pipeline hit its rate limit. Try again shortly.
{ "error": "upstream_rate_limited" }