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
    • 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}
public
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
instrument_code
string 
required
Defines market by using unique instrument
Example:
BTC_EUR
Query Params
unit
enum<string> 
required
Defines the unit of candlestick time granularity
Allowed values:
MINUTESHOURSDAYSWEEKSMONTHS
Example:
MINUTES
period
string 
required
Defines 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.
Example:
30
from
string 
required
Defines start of a query search
Example:
2024-11-11T16:42:33.450Z
to
string 
required
Defines end of a query search
Example:
2024-11-12T16:42:33.450Z
countBack
string 
optional
Defines the exact number of candlesticks to load

Responses

🟢200Success
application/json
Body
status
string 
required
candlesticks
array[object (Candlestick) {10}] 
required
last_sequence
integer 
required
instrument_code
string 
required
granularity
object 
required
high
string 
required
low
string 
required
open
string 
required
close
string 
required
volume
string 
required
time
string <date-time>
required
start_time
string 
required
Previous
Instruments
Next
Fee Groups
Built with