Actions31
- Market Data Actions
- Account Actions
- Order Actions
- Position Actions
Market Data → Get Candles
AI-generatedSummary
Fetch historical candlestick data for a trading pair from the Pacifica API
Inputs
- symbol — Trading pair symbol (e.g., BTC, ETH, SOL). Default: BTC
- interval — Candle interval. Options: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d. Default: 1h
- startTime — Start timestamp in milliseconds. Default: 0 (no start filter)
- endTime — End timestamp in milliseconds. Default: 0 (current time)
Output shape
Array of candle objects
Each candle object contains open, high, low, close, volume, and timestamp data returned by the Pacifica /api/v1/kline endpoint. The API is queried with parameters symbol, interval, start_time (always sent), and end_time (sent only if endTime > 0).
Examples
Example 1: Get 1-hour candles for BTC from midnight to now
symbol=BTC, interval=1h, startTime=1704067200000, endTime=0