Skip to main content
Version: Next

K-line Data

Get K-line historical data for a specified trading pair.

Interface Information

  • Method: GET
  • Path: /api/v1/stock/open-api/klines

Request Parameters

ParameterTypeRequiredDescription
symbolstringYesTrading pair symbol, e.g., msx, BTCUSDT
intervalstringYesK-line interval
startTimeint64NoStart timestamp (milliseconds)
endTimeint64NoEnd timestamp (milliseconds)
limitintNoNumber of results, default 500, max 1500

Supported K-line intervals:
1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1mo

Request Example

GET /api/v1/stock/open-api/klines?symbol=msx&interval=1m&limit=100

Response Fields

FieldTypeDescription
codeintStatus code
msgstringStatus message
data.symbolstringTrading pair
data.intervalstringK-line interval
data.klinesarrayK-line data list

Klines array elements:

  • t: Open time (millisecond timestamp)
  • o: Open price
  • h: High price
  • l: Low price
  • c: Close price
  • v: Volume

Response Example

{
"code": 0,
"msg": "success",
"data": {
"symbol": "msx",
"interval": "1m",
"klines": [
{
"t": 1737446400000,
"o": "1.2345",
"h": "1.2400",
"l": "1.2300",
"c": "1.2380",
"v": "12345.67"
},
{
"t": 1737446460000,
"o": "1.2380",
"h": "1.2450",
"l": "1.2350",
"c": "1.2420",
"v": "9876.54"
}
]
}
}