跳到主要內容

獲取標的列表

獲取標的列表

SDK Links

Python
longport.openapi.QuoteContext.security_list
Rust
longport::quote::QuoteContext#security_list
Go
QuoteContext.SecurityList
Node.js
QuoteContext#securityList

Request

HTTP MethodGET
HTTP URL/v1/quote/get_security_list

Parameters

Content-Type: application/json; charset=utf-8

NameTypeRequiredDescription
marketstringYES市場,目前只支持 US
categorystringYES市場下分類,目前只支持 Overnight

Request Example

from longport.openapi import QuoteContext, Config, Market, SecurityListCategory

config = Config.from_env()
ctx = QuoteContext(config)
resp = ctx.security_list(Market.US, SecurityListCategory.Overnight)
print(resp)

Response

Response Headers

  • Content-Type: application/json

Response Example

{
"code": 0,
"data": {
"list": [
{
"symbol": "BAC.US",
"name_cn": "美国银行",
"name_hk": "美國銀行",
"name_en": "Bank of America"
},
{
"symbol": "RDDT.US",
"name_cn": "REDDIT INC",
"name_hk": "REDDIT INC",
"name_en": "REDDIT INC"
},
{
"symbol": "GOOGL.US",
"name_cn": "谷歌-A",
"name_hk": "谷歌-A",
"name_en": "Alphabet"
}
]
}
}

Response Status

StatusDescriptionSchema
200返回成功security_response
400參數錯誤None

Schemas

security_response

NameTypeRequiredDescription
listobject[]false列表
∟ symbolintegertrue標的代碼
∟ name_cnstringtrue中文名稱
∟ name_hkstringtrue繁體名稱
∟ name_enstringtrue英文名稱

錯誤碼

業務錯誤碼描述排查建議
310010無效的請求請求參數有誤
310011服務端內部錯誤請重試或聯絡技術人員處理