跳到主要內容

獲取標的的期權鏈到期日列表

該接口用於獲取標的的期權鏈到期日列表。

信息

Request

Parameters

NameTypeRequiredDescription
symbolstring標的代碼,使用 ticker.region 格式,例如:700.HK

Protobuf

message SecurityRequest {
string symbol = 1;
}

Request Example

# 獲取標的的期權鏈到期日列表
# https://open.longportapp.com/docs/quote/pull/optionchain-date
# 運行前請訪問“開發者中心“確保賬戶有正確的行情權限。
# 如沒有開通行情權限,可以通過“LongPort”手機客戶端,並進入“我的 - 我的行情 - 行情商城”購買開通行情權限。
from longport.openapi import QuoteContext, Config

config = Config.from_env()
ctx = QuoteContext(config)

resp = ctx.option_chain_expiry_date_list("AAPL.US")
print(resp)

Response

Response Properties

NameTypeDescription
expiry_datestring[]標的對應的期權鏈到期日列表,使用 YYMMDD 格式

Protobuf

message OptionChainDateListResponse {
repeated string expiry_date = 1;
}

Response JSON Example

{
"expiry_date": [
"20220422",
"20220429",
"20220506",
"20220513",
"20220520",
"20220527",
"20220603",
"20220617",
"20220715",
"20220819",
"20220916",
"20221021",
"20221118",
"20230120",
"20230317",
"20230616",
"20230915",
"20240119",
"20240621"
]
}

錯誤碼

協議錯誤碼業務錯誤碼描述排查建議
3301600無效的請求請求參數有誤或解包失敗
3301606限流降低請求頻次
7301602服務端內部錯誤請重試或聯繫技術人員處理
7301600請求標的不存在檢查請求的 symbol 是否正確