行業子板塊層級樹
獲取行業分組的層級子板塊樹,含各節點股票數量、日漲跌幅和年初至今漲跌幅。Counter ID 可從 industry_rank 返回結果中獲取。
SDK Links
Python | longport.openapi.FundamentalContext.industry_peers |
Rust | longport::fundamental::FundamentalContext#industry_peers |
Go | FundamentalContext.IndustryPeers |
Node.js | FundamentalContext#industryPeers |
Parameters
SDK 方法參數。
| Name | Type | Required | Description |
|---|---|---|---|
| counter_id | string | 是 | 行業唯一標識(BK/市場/ID 格式),來源於 industry_rank |
| market | string | 是 | 市場代碼:US / HK / CN / SG |
Request Example
Response
Response Example
json
{
"code": 0,
"message": "success",
"data": {
"top": {"name": "All Industries", "market": "US"},
"chain": {
"name": "Technology",
"counter_id": "BK/US/IN00258",
"stock_num": 542,
"chg": "0.0231",
"ytd_chg": "0.0875",
"next": [
{
"name": "在线消费电子产品零售",
"counter_id": "",
"stock_num": 4,
"chg": "0.0268",
"ytd_chg": "-0.1869",
"next": []
}
]
}
}
}Response Status
| Status | Description | Schema |
|---|---|---|
| 200 | 成功 | IndustryPeersResponse |
| 400 | 請求錯誤 | None |
Schemas
IndustryPeersResponse
| Name | Type | Required | Description |
|---|---|---|---|
| top | object | 否 | 頂層行業資訊,見 IndustryPeersTop |
| chain | object | 否 | 行業層級樹根節點,見 IndustryPeerNode |
IndustryPeersTop
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | 否 | 頂層行業名稱 |
| market | string | 否 | 市場代碼 |
IndustryPeerNode
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | 否 | 板塊名稱 |
| counter_id | string | 否 | 板塊唯一標識(根節點有值,子節點為空字串) |
| stock_num | integer | 否 | 板塊內股票數量 |
| chg | string | 否 | 當日漲跌幅(小數,可能為空字串) |
| ytd_chg | string | 否 | 年初至今漲跌幅(小數,可能為空字串) |
| next | object[] | 否 | 子板塊列表,結構與當前節點相同(遞迴) |