Skip to content

K 線閉合時間 ​

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

批量查詢日、周、月、季、年 K 線在常規交易時段的理論閉合時間。請求和響應時間均使用 Unix 微秒,輸入時間不足 1 秒的部分向下取整到整秒。

請求參數 ​

參數類型位置必填說明
req_itemobject[]請求體是查詢項列表,每次 1 到 400 項
req_item[].market_codeinteger請求體否市場代碼;同時提供多種標識時優先級高於 security_id 和 src_code_item
req_item[].security_idinteger請求體否證券內部 ID
req_item[].src_code_itemobject請求體否交易代碼及交易所對象
req_item[].src_code_item.src_codestring請求體否交易所交易代碼,如 AAPL
req_item[].src_code_item.exchangestring請求體否交易所標識,如 US
req_item[].broker_idinteger請求體否券商 ID,僅數字貨幣使用
req_item[].kline_type_v2object請求體是K 線週期對象
req_item[].kline_type_v2.base_typeinteger請求體是基礎週期:支持 3(日)、4(周)、5(月)、6(季)、7(年);其他取值會觸發單項失敗(success=false)
req_item[].kline_type_v2.custom_numberinteger請求體是週期倍數,常規週期傳 1
req_item[].time_listobject[]請求體是待查詢的 K 線時間列表(非空)
req_item[].time_list[].time_keyinteger請求體是K 線時間,正整數,Unix 微秒時間戳;使用歷史 K 線返回的毫秒 time_key 時需乘以 1000

請求示例 ​

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}]}]}'

響應字段 ​

以下為 data 內字段。

字段類型說明
itemsobject[]按請求順序返回的各查詢項結果
items[].market_codeinteger回顯請求中的市場代碼,未傳時省略
items[].security_idstring回顯請求中的證券 ID(數字字符串形式),未傳時省略
items[].src_code_itemobject回顯請求中的交易代碼及交易所對象,未傳時省略
items[].src_code_item.src_codestring交易所交易代碼
items[].src_code_item.exchangestring交易所標識
items[].broker_idinteger回顯請求中的數字貨幣券商 ID,未傳時省略
items[].kline_type_v2object回顯請求的 K 線週期對象
items[].kline_type_v2.base_typeinteger基礎週期(失敗項可能回顯不支持的取值)
items[].kline_type_v2.custom_numberinteger週期倍數
items[].successboolean該項是否計算成功;即使頂層 code=0 也需逐項檢查
items[].time_listobject[]K 點和對應的理論閉合時間列表
items[].time_list[].time_keyintegerK 點時間,Unix 微秒時間戳
items[].time_list[].close_timeinteger理論閉合時間,Unix 微秒時間戳;無法計算或單項失敗時省略

響應示例 ​

示例中的港股日 K 理論閉合時間對應香港時間 2026 年 11 月 2 日 16:00。

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
          }
        ]
      }
    ]
  }
}

將請求示例的 base_type 改為 2(分鐘)時,批次仍返回 code=0,該項返回 success=false 並省略 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
          }
        ]
      }
    ]
  }
}

錯誤碼 ​

失敗響應(code != 0)會在頂層附加 trace_id(code=0 時省略)。

code說明
-3請求體或參數不合法,例如 req_item 為空或超過 400 項、缺少 kline_type_v2 / time_list 或 time_key 小於 1
-5內部計算處理失敗
-9當前訪問策略拒絕
-11請求過於頻繁,按 Retry-After 秒數退避
-13限頻服務暫不可用

說明 ​

  • 每項需提供 market_code、security_id、src_code_item 之一;同時提供多個時按 market_code → security_id → src_code_item 順序選取。
  • code=0 僅表示批量請求已受理,需逐項檢查 items[].success;缺失 close_time 表示未計算出閉合時間,不應按 0 處理。