Skip to content

History K-Line

GET /api/v1.0/quote/{symbol}/history-kline

Get historical K-line (candlestick) data with pagination support.

Parameters

NameTypeInRequiredDescription
symbolstringpathyesSymbol code, e.g. US.FUTU.
startstringquerynoStart date (yyyy-MM-dd).
endstringqueryyesEnd date (yyyy-MM-dd).
ktypeintquerynoK-line type. Default 2. 1=1min, 2=Day, 3=Week, 4=Month, 5=Year, 6=5min, 7=15min, 8=30min, 9=60min. See Naming Dictionary.
autypeintquerynoAdjustment type. Default 1. 0=None, 1=Forward, 2=Backward. See Naming Dictionary.
numintquerynoNumber of bars. Default 370, max 370.
extended_timeintquerynoExtended hours. Default 0. 0=Default, 1=Include pre/after market (US minute K), 2=Include overnight (US). See Naming Dictionary.

Request Example

bash
curl 'https://webapi.moomoo.com/api/v1.0/quote/US.FUTU/history-kline?start=2026-05-20&end=2026-05-23' | jq

Response Fields

FieldTypeDescription
kline_list[].time_keyintK-line time, millisecond timestamp
kline_list[].dateintK-line date YYYYMMDD (for minute K-lines it is the trading date; for daily and above it is the local date corresponding to the timestamp)
kline_list[].time_zoneintTimezone offset (minutes, relative to UTC), e.g. 480 (HK) / -300 (US daylight saving)
kline_list[].openfloatOpen price
kline_list[].closefloatClose price
kline_list[].highfloatHigh price
kline_list[].lowfloatLow price
kline_list[].volumeintVolume (shares)
kline_list[].turnoverfloatTurnover (amount)
kline_list[].last_closefloatPrevious close price
kline_list[].pe_ratiofloatPrice-to-earnings ratio
kline_list[].turnover_ratefloatTurnover rate (percentage)
kline_list[].change_ratefloatChange rate (percentage, relative to previous close)
kline_list[].namestringStock English name
kline_list[].sc_namestringStock Simplified Chinese name
kline_list[].tc_namestringStock Traditional Chinese name
kline_list[].open_interestintOpen interest. Only returned for futures/options; other categories return 0 or omit
kline_list[].settle_pricefloatSettlement price. Only meaningful for futures/options (daily K and above); for stocks/ETFs/indices the backend backfills with close price, callers should ignore
kline_list[].implied_volatilityfloatImplied volatility (percentage). Only returned for options; other categories return 0 or omit
next_timeintNext page start time (millisecond timestamp, pass back as the next page's end parameter)
volume_precisionintVolume precision n. kline_list[].volume has been scaled by 10^n; callers need to divide by 10^n to restore. Only special categories like event contracts/crypto may have >0; stocks/ETFs/futures/options are generally 0

Supported Markets

  • Code must use a supported market prefix from the registered market prefixes; otherwise returns invalid_symbol (e.g. HK / US / SH / SZ / BJ / SG / CA / AU / FX / JP / CC / FT, etc.).
  • Supported categories: Stocks / ETFs / Indices / Futures / Options / Crypto; unsupported categories like preferred shares / SPACs / convertible bonds / CBBCs return an empty kline_list.
  • Market prefixes not in the gateway enum (e.g. UK / IT): returns ret_code=-8 unsupported.

Error Codes

ret_codeerror.codeTrigger ConditionRecommended Action
0Success; when valid but no data, kline_list is an empty array
-3invalid_parameterMissing required field (end) / type error / invalid enum (ktype out of range) / date format mismatchCorrect parameters and retry
-7invalid_symbolsymbol format is valid but security not found in cache (e.g. HK.99999999)Use the search API to confirm symbol validity
-8unsupportedMarket prefix not in gateway supported range (e.g. UK.HSBA / IT.STM)Confirm whether the market prefix is supported

Response Example

json
{
  "ret_code": 0,
  "ret_msg": "success",
  "data": {
    "kline_list": [
      {
        "change_rate": 0.17670682730923695,
        "close": 124.72,
        "high": 127.45,
        "last_close": 124.5,
        "low": 122.7,
        "name": "富途控股",
        "open": 124.12,
        "pe_ratio": 17.728,
        "time_key": 1779249600000,
        "turnover": 370529897,
        "turnover_rate": 0.49348,
        "volume": 2960896
      },
      {
        "change_rate": -0.689544579858884,
        "close": 123.86,
        "high": 125.45,
        "last_close": 124.72,
        "low": 122.1,
        "name": "富途控股",
        "open": 122.7,
        "pe_ratio": 17.606,
        "time_key": 1779336000000,
        "turnover": 271859605,
        "turnover_rate": 0.36631,
        "volume": 2197832
      }
    ]
  }
}