Commodities

Historical commodity OHLC bars (gzip required)

Requires Accept-Encoding: gzip. Covers precious metals (XAUUSD, XAGUSD, XPTUSD, XPDUSD), energy, and industrials (e.g. XCUUSD copper, USOUSD WTI, NATGAS). Volume may be 0 for instruments without a reported tick count. When start predates upstream coverage the API returns 422 with code data_unavailable and an earliest field carrying the first date it can serve.

get/v1/hist/commodities/{symbol}/bars

Request

Path parameters

symbolstring required

Commodity code (4-12 upper alphanumerics), e.g. XAUUSD, XCUUSD.

Query parameters

startstring required

Inclusive lower bound (YYYY-MM-DD or RFC3339). Required.

endstring

Inclusive upper bound. Default now.

interval'1m' | '5m' | '15m' | '30m' | '1h' | '1d' | '1w' | '1mo'

Bar interval. Default 1m. Full set: intraday (1m–1h), 1d (daily candle with a true session boundary), 1w (Monday-aligned), and 1mo (calendar month), all aggregated from 1-minute history.

order'asc' | 'desc'

Sort direction by time. asc (default) returns oldest→newest. desc returns newest→oldest and anchors the first page at the most recent bar, so fetching the latest N costs one request instead of paging the whole window. Supported on commodities and forex only; other historical routes are ascending-only.

cursorstring

Opaque pagination cursor from a previous response's meta.next_cursor.

limitinteger

Headers

Accept-Encoding'gzip' required

Must include gzip; this endpoint returns 406 otherwise.

Response

OHLC bars.

Changes

No recorded changes to this operation across all 1 revision of this API.