Skip to main content
const candles = await client.getCandles({
  pairId: 0,
  from: Date.now() - 30 * 24 * 60 * 60 * 1000,
  resolution: '1D',
  sets: 3,
});
sets controls how many candle pages the SDK requests. It defaults to 1; when greater than 1, the SDK uses the previous page’s last candle timestamp as the next request cursor and returns one flattened array. Supported resolutions:
  • "1"
  • "5"
  • "15"
  • "60"
  • "240"
  • "1D"

Parameters

interface GetCandlesParams {
  pairId: string | number;
  from: number;
  to?: number;
  resolution: '1' | '5' | '15' | '60' | '240' | '1D';
  sets?: number;
}

Response schema

type Response = Array<{
  pairFrom: string;
  pairTo: string;
  time: number;
  open: number;
  high: number;
  low: number;
  close: number;
}>;