Get candles
OHLC candles at a 60, 3600 or 86400 second interval; volumeContracts counts fills, including the venue's own USDhb hedge legs.
GET
https://testnet.hardbasis.com/v1/markets/{id}/candlesbash
curl -fsS "$HB/v1/markets/$ID/candles"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
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());json
{
"interval": 60,
"candles": [
{
"tsMs": "100000",
"oQ8": "100000",
"hQ8": "100000",
"lQ8": "100000",
"cQ8": "100000",
"prints": 0,
"seeded": true,
"volumeContracts": "100000"
}
]
}json
{
"error": "string",
"code": "not_found"
}Path parameters
idstringrequiredQuery parameters
intervalenumoptionalCandle 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.
60360086400limitstringoptionalNumber of most-recent candles to return, 1..1440 (default 96): one UTC day of the 1m base in a single request.
Responses
200 OKintervalconst 60 | const 3600 | const 86400requiredcandlesobject[]requiredShow 8 child fields
tsMsstringmsrequiredoQ8stringq8requiredhQ8stringq8requiredlQ8stringq8requiredcQ8stringq8requiredprintsintegerrequiredseededbooleanoptionalvolumeContractsstringcontractsoptional