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].
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"instId": "<instId>"
},
"name": "crypto_candles"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bar | No | 1H | |
| limit | No | ||
| instId | Yes | OKX instrument id, e.g. BTC-USDT or BTC-USDT-SWAP |