Skip to content

K-line closing times ​

POST /api/v1.0/quote/kline-close-time

Batch query theoretical closing times of regular-session day, week, month, quarter, or year bars. Both request and response timestamps use Unix microseconds, with subsecond inputs rounded down to whole seconds.

Request parameters ​

ParameterTypeInRequiredDescription
req_itemobject[]bodyYesBatch of 1 to 400 request items
req_item[].market_codeintegerbodyNoMarket code; takes priority over security_id and src_code_item when multiple identifiers are provided
req_item[].security_idintegerbodyNoInternal security ID
req_item[].src_code_itemobjectbodyNoTrading code and exchange pair
req_item[].src_code_item.src_codestringbodyNoExchange ticker, e.g. AAPL
req_item[].src_code_item.exchangestringbodyNoExchange code, e.g. US
req_item[].broker_idintegerbodyNoBroker ID for crypto instruments only
req_item[].kline_type_v2objectbodyYesK-line interval object
req_item[].kline_type_v2.base_typeintegerbodyYesBase cycle: supports 3 (day), 4 (week), 5 (month), 6 (quarter), and 7 (year); other values fail the item (success=false)
req_item[].kline_type_v2.custom_numberintegerbodyYesInterval multiplier; pass 1 for standard periods
req_item[].time_listobject[]bodyYesNon-empty list of K-line bar timestamps to query
req_item[].time_list[].time_keyintegerbodyYesBar timestamp as a positive integer in Unix microseconds; multiply millisecond time_key values from Historical Candlesticks by 1000

Request example ​

bash
curl -s -X POST "https://webapi.futunn.com/api/v1.0/quote/kline-close-time" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"req_item":[{"market_code":1,"kline_type_v2":{"base_type":3,"custom_number":1},"time_list":[{"time_key":1793548800000000}]}]}'

Response fields ​

Fields under data.

FieldTypeDescription
itemsobject[]Per-item results in request order
items[].market_codeintegerEchoed market code; omitted when not provided
items[].security_idstringEchoed security ID as a numeric string; omitted when not provided
items[].src_code_itemobjectEchoed trading code and exchange pair; omitted when not provided
items[].src_code_item.src_codestringExchange ticker
items[].src_code_item.exchangestringExchange code
items[].broker_idintegerEchoed crypto broker ID; omitted when not provided
items[].kline_type_v2objectEchoed K-line interval object
items[].kline_type_v2.base_typeintegerBase cycle type (failed items may echo unsupported values)
items[].kline_type_v2.custom_numberintegerInterval multiplier
items[].successbooleanWhether this item succeeded; check per item even when top-level code is 0
items[].time_listobject[]Bar timestamps and theoretical closing times
items[].time_list[].time_keyintegerBar timestamp in Unix microseconds
items[].time_list[].close_timeintegerTheoretical closing time in Unix microseconds; omitted when unavailable or failed

Response example ​

The Hong Kong daily bar in this example closes at 16:00 local time on November 2, 2026.

json
{
  "code": 0,
  "message": "success",
  "data": {
    "items": [
      {
        "kline_type_v2": {
          "base_type": 3,
          "custom_number": 1
        },
        "market_code": 1,
        "success": true,
        "time_list": [
          {
            "close_time": 1793606400000000,
            "time_key": 1793548800000000
          }
        ]
      }
    ]
  }
}

When base_type is changed to 2 (minute), the batch still returns code=0, while that item returns success=false and omits close_time:

json
{
  "code": 0,
  "message": "success",
  "data": {
    "items": [
      {
        "kline_type_v2": {
          "base_type": 2,
          "custom_number": 1
        },
        "market_code": 1,
        "success": false,
        "time_list": [
          {
            "time_key": 1793548800000000
          }
        ]
      }
    ]
  }
}

Errors ​

Failed responses (code != 0) include top-level trace_id (omitted when code=0).

codeDescription
-3Invalid body or parameter, such as empty req_item, exceeding 400 items, missing kline_type_v2 or time_list, or time_key below 1
-5Internal calculation failure
-9Access denied by policy
-11Rate limit exceeded; back off for Retry-After seconds
-13Rate-limit service unavailable

Notes ​

  • Supply at least one of market_code, security_id, or src_code_item per item; when multiple are supplied, precedence is market_code, then security_id, then src_code_item.
  • code=0 only indicates the batch was accepted; inspect items[].success per item, and do not treat an omitted close_time as zero.