One Trading API
REST API
WebSocket API
REST API
WebSocket API
  1. Public
  • Public
    • Currencies
      GET
    • Instruments
      GET
    • Candlesticks
      GET
    • Fee Groups
      GET
    • Order Book
      GET
    • Market Ticker
      GET
    • Market Ticker For Instrument
      GET
    • Time
      GET
  • Trading
    • Get Orders
      GET
    • Create Order
      POST
    • Get Order by Client ID
      GET
    • Get Order by Order ID
      GET
    • Balances
      GET
    • Subaccounts
      GET
    • Fees
      GET
    • Get Trades for Order
      GET
    • Get Trade by Trade ID
      GET
    • Get Trades
      GET
    • Cancel All Orders
      DELETE
    • Cancel Order by Order ID
      DELETE
    • Cancel Order by Client ID
      DELETE
  • Futures
    • Introduction
    • Funding Rate Methodology
    • Funding Payments
      GET
    • Positions
      GET
    • Position Funding Payments
      GET
    • Funding Rate Settings
      GET
    • Get Futures Open Positions
      GET
    • Futures Portfolio Summary
      GET
    • Current Funding Rate
      GET
    • Funding Rate History
      GET
    • Funding Schedule
      GET
  • Funding
    • Transfer Subaccount Balance
      POST
    • Get Transactions
      GET
  1. Public

Candlesticks

GET
https://api.onetrading.com/fast/v1/candlesticks/{instrument_code}
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.

Request

Path Params

Query Params

Responses

🟢200Success
application/json
Bodyapplication/json

🟠400Bad Request
🔴500Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location '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&countBack=undefined'
Response Response Example
200 - Success Example
{
    "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"
        }
    ]
}
Previous
Instruments
Next
Fee Groups
Built with