curl https://builder.ostium.io/v1/ohlc \
-H 'Content-Type: application/json' \
-d '{
"pair": "BTC-USD",
"fromTimestampSeconds": 1711929600,
"toTimestampSeconds": 1714521600,
"resolution": "1D"
}'
const candles = await client.getCandles({
pairId: 0,
from: Date.now() - 30 * 24 * 60 * 60 * 1000,
resolution: '1D',
});
Response schema
interface Response {
data: Array<{
from: string;
to: string;
time: number;
open: number;
high: number;
low: number;
close: number;
}>;
lastRequestTimestamp: number | null;
}