Skip to main content
curl https://builder.ostium.io/v1/ohlc \
  -H 'Content-Type: application/json' \
  -d '{
    "pair": "BTC-USD",
    "fromTimestampSeconds": 1711929600,
    "toTimestampSeconds": 1714521600,
    "resolution": "1D"
  }'
SDK equivalent:
const candles = await client.getCandles({
  pairId: 0,
  from: Date.now() - 30 * 24 * 60 * 60 * 1000,
  resolution: '1D',
  sets: 3,
});
sets is SDK-side pagination. The direct Builder API response includes lastRequestTimestamp; the SDK handles repeated requests and returns one flattened candle array.

Request schema

interface Request {
  pair: string;
  fromTimestampSeconds: number;
  toTimestampSeconds: number;
  resolution: '1' | '5' | '15' | '60' | '240' | '1D';
}

Response schema

interface Response {
  data: Array<{
    from: string;
    to: string;
    time: number;
    open: number;
    high: number;
    low: number;
    close: number;
  }>;
  lastRequestTimestamp: number | null;
}