Skip to main content

Get Kline

Query for historical klines (also known as candles/candlesticks). Charts are returned in groups based on the requested interval.

Covers: Spot / USDT perpetual / USDC contract / Inverse contract

HTTP Request

GET /v5/market/kline

Request Parameters

ParameterRequiredTypeComments
categoryfalsestringProduct type. spot,linear,inverse
  • When category is not passed, use linear by default
  • symboltruestringSymbol name
    intervaltruestringKline interval. 1,3,5,15,30,60,120,240,360,720,D,M,W
    startfalseintegerThe start timestamp (ms)
    endfalseintegerThe end timestamp (ms)
    limitfalseintegerLimit for data size per page. [1, 1000]. Default: 200

    Response Parameters

    ParameterTypeComments
    categorystringProduct type
    symbolstringSymbol name
    listarray
    • An string array of individual candle
    • Sort in reverse by startTime
    > list[0]: startTimestringStart time of the candle (ms)
    > list[1]: openPricestringOpen price
    > list[2]: highPricestringHighest price
    > list[3]: lowPricestringLowest price
    > list[4]: closePricestringClose price. Is the last traded price when the candle is not closed
    > list[5]: volumestringTrade volume. Unit of contract: pieces of contract. Unit of spot: quantity of coins
    > list[6]: turnoverstringTurnover. Unit of figure: quantity of quota coin

    Request Example

    GET /v5/market/kline?category=inverse&symbol=BTCUSD&interval=60&start=1670601600000&end=1670608800000 HTTP/1.1
    Host: api-testnet.bybit.com

    Response Example

    {
    "retCode": 0,
    "retMsg": "OK",
    "result": {
    "symbol": "BTCUSD",
    "category": "inverse",
    "list": [
    [
    "1670608800000",
    "17071",
    "17073",
    "17027",
    "17055.5",
    "268611",
    "15.74462667"
    ],
    [
    "1670605200000",
    "17071.5",
    "17071.5",
    "17061",
    "17071",
    "4177",
    "0.24469757"
    ],
    [
    "1670601600000",
    "17086.5",
    "17088",
    "16978",
    "17071.5",
    "6356",
    "0.37288112"
    ]
    ]
    },
    "retExtInfo": {},
    "time": 1672025956592
    }