mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 15:44:15 +08:00
feat(web): add THS stock associations API
This commit is contained in:
@@ -375,6 +375,46 @@ curl "http://localhost:8000/api/v1/stock/industry?market=SH&code=600519"
|
||||
|
||||
---
|
||||
|
||||
## Web API:同花顺网页关联板块
|
||||
|
||||
### GET `/api/v1/ths/stock/associations`
|
||||
|
||||
按同花顺公开 F10 网页的分类,返回股票的三级行业和概念板块,并从各板块公开详情页补充
|
||||
当日涨跌幅和涨幅排行首只成分股。适合实现类似同花顺“盘口”中的“行业板块”“概念板块”区域。
|
||||
|
||||
> 这是网页解析接口,不是同花顺官方开放 API。请遵守同花顺网站规则,勿用于高频抓取、
|
||||
> 商业再分发或作为交易决策的唯一数据源。网页未公开或暂时不可读取的行情字段会返回 `null`;
|
||||
> 接口不会伪造同花顺 App 的“最相关”“对应人气股”等私有排序。
|
||||
|
||||
**请求参数**:
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| `code` | `string` | 是 | 6 位 A 股代码,如 `688126` |
|
||||
| `concept_limit` | `integer` | 否 | 返回概念板块数量,默认 `10`,最大 `30`;总数见 `concept_total` |
|
||||
|
||||
**本地验证示例(688126)**:
|
||||
|
||||
```bash
|
||||
curl "http://127.0.0.1:8001/api/v1/ths/stock/associations?code=688126&concept_limit=3"
|
||||
```
|
||||
|
||||
**响应字段**:
|
||||
|
||||
| 字段 | 说明 |
|
||||
|------|------|
|
||||
| `source` | 固定为 `ths_web`,明确表示来自同花顺公开网页解析 |
|
||||
| `industries` | 三级行业数组;`level` 为层级,`board_code`、`change_pct`、`leader` 可能为空 |
|
||||
| `concepts` | 按 `concept_limit` 返回的概念板块数组 |
|
||||
| `concept_total` | 该股票在同花顺 F10 中的概念板块总数 |
|
||||
| `leader` | 公开详情页涨幅排行中的首只成分股,非同花顺 App 的“对应人气股” |
|
||||
| `leader_codes` | F10 页面若公开了板块关联股票代码则返回,否则为空数组 |
|
||||
|
||||
行业归属每次请求重新读取;行业和概念详情行情只在当日内短时缓存 30 秒,并且每次最多并发读取
|
||||
4 个板块详情,以降低对来源网页的压力。
|
||||
|
||||
---
|
||||
|
||||
## 资金流向
|
||||
|
||||
### get_fund_flow
|
||||
|
||||
Reference in New Issue
Block a user