---
title: "Historical commodity OHLC bars (gzip required)"
method: GET
path: "/v1/hist/commodities/{symbol}/bars"
tags: ["Commodities"]
---

# Historical commodity OHLC bars (gzip required)

`GET /v1/hist/commodities/{symbol}/bars`

## Request

- Base URL: `https://api.sifting.io`
- URL: `https://api.sifting.io/v1/hist/commodities/{symbol}/bars`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in query parameter `api_key`
- TypeScript: <https://skmtc.dev/sifting/apis/siftingio-market-data-api/docs/v1/hist/commodities/:symbol/bars/get.ts> (a function with typed inputs; its response is checked against the schema)

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.

## Path parameters

- `symbol` string, required

## Query parameters

- `start` string, required
- `end` string
- `interval` '1m' | '5m' | '15m' | '30m' | '1h' | '1d' | '1w' | '1mo'
- `order` 'asc' | 'desc'
- `cursor` string
- `limit` integer

## Headers

- `Accept-Encoding` 'gzip', required

## Response `200`

OHLC bars.

- BarsResponse
  - `data` Bar[]
    - `t` integer: Bar open time, Unix epoch ms.
    - `o` number
    - `h` number
    - `l` number
    - `c` number
    - `v` number
  - `meta` BarsMeta
    - `as_of` string, date-time
    - `next_cursor` string
    - `symbol` string
    - `interval` string

## Other responses

- `400`: Invalid request parameters.
- `401`: Missing or invalid API key.
- `404`: Resource not found.
- `406`: This endpoint requires `Accept-Encoding: gzip`.
- `422`: No upstream has data for the requested window.
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/sifting/apis/siftingio-market-data-api.md) - [All operations](https://skmtc.dev/sifting/apis/siftingio-market-data-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sifting/apis/siftingio-market-data-api/revisions/c570068c2359?raw)
