Candlesticks
Get instrument candlesticks. The response contains up to countBack candles (default and maximum 5000), newest first, ending at the last complete candle before to. from is validated (it must be a valid timestamp, not in the future and not after to) but does not limit the results: to receive only the candles in a range, set countBack to the number of candles you need. Fewer candles than requested may be returned where there are gaps in the history.
If there is trading volume in a candle's period, it is based on trades. If there is no volume in a candle's period, it is based on the mid price (bid/ask average).
When no candles are found, status is no_data and candlesticks is omitted; next_bar then gives the start time of the most recent candle before from, if there is one.
instrument_code*stringThe instrument code, e.g. BTC_USDC.
unit*stringDefines the unit of candlestick time granularity (case-insensitive).
"MINUTES""HOURS""DAYS""WEEKS""MONTHS"period*stringDefines the period of candlestick time granularity.
Combined with the unit, supported resolutions are 1, 5, 15, 30 MINUTES & 1, 4 HOURS & 1 DAYS & 1 WEEKS & 1 MONTHS.
from*stringISO 8601 timestamp. Must be a valid date, not in the future, and not after to. It does not limit the candles returned (see description).
date-timeto*stringISO 8601 timestamp. Candles are returned ending at the last complete candle before this time.
date-timecountBack?stringNumber of candles to return, newest first. Integer between 1 and 5000; defaults to 5000.
^[0-9]+$"5000"OK
application/json- response
status*stringdata when candles were found, otherwise no_data.
"data""no_data"candlesticks?array<>Candles, newest first. Present only when status is data.
next_bar?stringOnly when status is no_data: start time of the most recent candle before from, if any.
date-timecurl -X GET 'https://api.onetrading.com/fast/v1/candlesticks/BTC_USDC?unit=MINUTES&period=30&from=2026-02-11T16%3A42%3A33.450Z&to=2026-12-12T16%3A42%3A33.450Z'{ "status": "data", "candlesticks": [ { "last_sequence": 1730900885466242800, "instrument_code": "BTC_EUR", "granularity": { "unit": "MINUTES", "period": 30 }, "high": "100000", "low": "100000", "open": "100000", "close": "100000", "volume": "2000.00", "time": "2024-11-06T13:59:59.999Z", "start_time": "2024-11-06T13:30:00.000Z" }, { "last_sequence": 1730369352914576100, "instrument_code": "BTC_EUR", "granularity": { "unit": "MINUTES", "period": 30 }, "high": "100000", "low": "100000", "open": "100000", "close": "100000", "volume": "100.00", "time": "2024-10-31T10:29:59.999Z", "start_time": "2024-10-31T10:00:00.000Z" }, { "last_sequence": 1730368016064669000, "instrument_code": "BTC_EUR", "granularity": { "unit": "MINUTES", "period": 30 }, "high": "10000", "low": "10000", "open": "10000", "close": "10000", "volume": "20.00", "time": "2024-10-31T09:59:59.999Z", "start_time": "2024-10-31T09:30:00.000Z" }, { "last_sequence": 1730362835479252000, "instrument_code": "BTC_EUR", "granularity": { "unit": "MINUTES", "period": 30 }, "high": "100000", "low": "100000", "open": "100000", "close": "100000", "volume": "100.00", "time": "2024-10-31T08:29:59.999Z", "start_time": "2024-10-31T08:00:00.000Z" }, { "last_sequence": 1730330727170770700, "instrument_code": "BTC_EUR", "granularity": { "unit": "MINUTES", "period": 30 }, "high": "100000", "low": "100000", "open": "100000", "close": "100000", "volume": "200.00", "time": "2024-10-30T23:29:59.999Z", "start_time": "2024-10-30T23:00:00.000Z" }, { "last_sequence": 1730328614342880500, "instrument_code": "BTC_EUR", "granularity": { "unit": "MINUTES", "period": 30 }, "high": "100000", "low": "100000", "open": "100000", "close": "100000", "volume": "100.00", "time": "2024-10-30T22:59:59.999Z", "start_time": "2024-10-30T22:30:00.000Z" } ]}