---
title: GET /v1/markets/{id}/candles
---

# `GET /v1/markets/{id}/candles`

Get candles

OHLC candles at a 60, 3600 or 86400 second interval; volumeContracts counts fills, including the venue's own USDhb hedge legs.

Money, price, rate and count fields cross the wire as decimal strings; units are shown beside each field ([Wire encoding](/api/wire-encoding)). Group: [Markets](/api/reference/markets/).

**Auth:** none (public)

**Effect:** `read`: reads only

## Parameters

- <span id="param-id"></span>`id` (path) · string · required
- <span id="param-interval"></span>`interval` (query) · enum(`60`, `3600`, `86400`) · optional: Candle interval in SECONDS (integer, Coinbase granularity convention, not a label like "1m"): 60 (1m print-fold base, 96h retention), 3600 or 86400 (permanent rollups). Default 60. Aggregate intermediate frames (5m/15m/4h) client-side.
- <span id="param-limit"></span>`limit` (query) · string · optional: Number of most-recent candles to return, 1..1440 (default 96): one UTC day of the 1m base in a single request.

## Request

```bash [curl]
curl -fsS "$HB/v1/markets/$ID/candles"
```

```python [Python]
import os

import requests

HB = os.environ.get("HB", "https://testnet.hardbasis.com")
ID = os.environ["ID"]

resp = requests.get(
    f"{HB}/v1/markets/{ID}/candles",
)
resp.raise_for_status()
print(resp.json())
```

```ts [TypeScript]
const HB = process.env.HB ?? "https://testnet.hardbasis.com";
const ID = process.env.ID!;

const res = await fetch(`${HB}/v1/markets/${ID}/candles`, {
  method: "GET",
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(await res.json());
```

## Responses

- **200**: OK
  - <span id="res-200-interval"></span>`interval` · const `60` \| const `3600` \| const `86400` · required
  - <span id="res-200-candles"></span>`candles` · object[] · required
    - <span id="res-200-candles-tsMs"></span>`tsMs` · string · unit `ms` · required
    - <span id="res-200-candles-oQ8"></span>`oQ8` · string · unit `q8` · required
    - <span id="res-200-candles-hQ8"></span>`hQ8` · string · unit `q8` · required
    - <span id="res-200-candles-lQ8"></span>`lQ8` · string · unit `q8` · required
    - <span id="res-200-candles-cQ8"></span>`cQ8` · string · unit `q8` · required
    - <span id="res-200-candles-prints"></span>`prints` · integer · required
    - <span id="res-200-candles-seeded"></span>`seeded` · boolean · optional
    - <span id="res-200-candles-volumeContracts"></span>`volumeContracts` · string · unit `contracts` · optional

Example `200` response:

```json
{
  "interval": 60,
  "candles": [
    {
      "tsMs": "100000",
      "oQ8": "100000",
      "hQ8": "100000",
      "lQ8": "100000",
      "cQ8": "100000",
      "prints": 0,
      "seeded": true,
      "volumeContracts": "100000"
    }
  ]
}
```

## Errors

Every refusal carries a stable `code` from [`ErrorCode`](/api/reference/all#errorcode) beside human `error` prose; match on the code. See [Errors](/api/errors).

- **404**: A refusal carrying a stable machine `code` (ErrorCode) beside human `error` prose.
