GET
/v1/hist/commodities/:symbol/barsgzip requiredCommodities bars
Paginated OHLCV bars for a commodity, from 1-minute through monthly. 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.
- Auth
X-API-Keyheader- Format
- JSON, gzip-encoded
- Rate limits
- Per-key, see limits
Example
request · shell
curl -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"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 onlyParameters
ParameterDescription
Parameter
symbolrequiredstring · path- Commodity code, 4–12 uppercase alphanumerics. e.g. XAUUSD (gold), XAGUSD (silver), XPTUSD (platinum), XPDUSD (palladium). Case-insensitive.
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, 1d, 1w, 1mo. Default 1m, honored exactly. Same enum across every /hist/* bars endpoint, so a single client schema works across asset classes.
orderstring · query- Sort direction by bar time. One of: asc, desc. Default asc (oldest first), the natural order for charting and forward pagination. Pass desc to return the most recent bars first.
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.
Response fields
FieldDescription
Field
data[]array- OHLCV bars, oldest first, one per interval bucket.
data[].tint64 (epoch ms)- Bar open time, Unix epoch milliseconds, UTC. The bar covers [t, t + interval).
data[].ofloat- Open price, USD.
data[].hfloat- High price, USD.
data[].lfloat- Low price, USD.
data[].cfloat- Close price, USD.
data[].vinteger- Tick-count volume: the number of price updates in the bucket.
meta.symbolstring- Echoed symbol.
meta.intervalstring- Echoed bar size.
meta.as_ofstring- When the response was produced. RFC 3339, UTC.
meta.next_cursorstring- Opaque pagination token. Present only when the page came back full and more data exists before end; absent at the tail.
Reference
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" }