One Trading API
REST APIWebSocket API
REST APIWebSocket 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
    • Balances
      GET
    • Fees
      GET
    • Get Orders
      GET
    • Create Order
      POST
    • Get Order by Order ID
      GET
    • Get Order by Client ID
      GET
    • Cancel All Orders
      DELETE
    • Cancel Order by Order ID
      DELETE
    • Cancel Order by Client ID
      DELETE
    • Get Trades for Order
      GET
    • Get Trades
      GET
    • Get Trade by Trade ID
      GET
  • Futures
    • Introduction
    • Funding Rate Methodology
    • Funding Payments
      GET
    • Current Funding Rate
      GET
    • Funding Rate History
      GET
    • Futures Portfolio Summary
      GET
    • Get Futures Open Positions
      GET
  1. Public

Candlesticks

GET
https://api.onetrading.com/fast/v1/candlesticks/{instrument_code}
Get instrument candlesticks for a specified time period. The requested time period may include up to 5000 candlesticks; for example, a request for minutely candles is limited to at most approximately 83 hours. Please note that fewer candlesticks than the theoretical limit may be provided for a given time period due to gaps in trading activity. Additionally, the endpoint now accepts a parameter called 'countBack,' which specifies the exact number of bars to load. If not provided, the default value is set to 5000. It's important to note that 'countBack' takes precedence over 'from' when both parameters are present.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.onetrading.com/fast/v1/candlesticks/BTC_EUR?unit=MINUTES&period=30&from=2024-11-11T16:42:33.450Z&to=2024-11-12T16:42:33.450Z'
Response Response 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"
        }
    ]
}

Request

Path Params

Query Params

Responses

🟢200Success
application/json
Body

Previous
Instruments
Next
Fee Groups
Built with