Crypto candlesticks (OKX, spot or perp)
crypto_candlesRetrieve OHLCV candlestick data for spot or perpetual-swap crypto instruments like BTC-USDT. Specify instrument ID, timeframe, and limit to get historical rows including open, high, low, close, volume, and confirm.
Instructions
OHLCV candlesticks for a crypto instrument. Use spot ids like 'BTC-USDT' or perpetual-swap ids like 'BTC-USDT-SWAP'. Rows: [ts, open, high, low, close, vol, volCcy, volCcyQuote, confirm].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bar | No | 1H | |
| limit | No | ||
| instId | Yes | OKX instrument id, e.g. BTC-USDT or BTC-USDT-SWAP |