查询 A 股股票代码变更历史。用户问股票代码变更、原代码、代码迁移、招保诚原代码、001872 之前代码、920000 升板前代码、新三板升北交所时使用。参数 trade_code 必填且需带 .SZ/.SH/.BJ 后缀,支持逗号分隔多个代码。
Scanned 9/2/2026
Install to Claude Code
npx -y skills add FTShare-Lab/FTShare-skill --skill stk-code-change --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Stk Code Change?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/ftshare-lab-stk-code-change)More formats (shields.io, HTML) on the badges page.
---
name: stk-code-change
description: "查询 A 股股票代码变更历史。用户问股票代码变更、原代码、代码迁移、招保诚原代码、001872 之前代码、920000 升板前代码、新三板升北交所时使用。参数 trade_code 必填且需带 .SZ/.SH/.BJ 后缀,支持逗号分隔多个代码。"
---
# 查询 A 股代码变更历史
## 接口说明
| 项目 | 说明 |
|----------|-----------------------------------------------------|
| 接口名称 | 查询 A 股代码变更历史 |
| 外部接口 | `/api/v1/market/data/stk-code-change` |
| 请求方式 | GET |
| 适用场景 | 按股票代码查询其历史代码变更记录及每个代码的起止使用区间 |
## 请求参数
| 参数名 | 类型 | 是否必填 | 描述 | 取值示例 | 备注 |
|-------------|--------|----------|-----------------------------------------------------|--------------|-----------------------------------------------------------------------|
| trade_code | string | 是 | 股票最新代码 | 001872.SZ | 带 .SZ/.SH/.BJ 后缀,支持逗号分隔多个,如 `001872.SZ,920000.BJ` |
| start_date | string | 否 | 过滤区间起始日期 | 20180101 | `YYYYMMDD` 格式;与 `end_date` 同时提供时须 `start_date` ≤ `end_date` |
| end_date | string | 否 | 过滤区间结束日期 | 20241231 | `YYYYMMDD` 格式;与 `start_date` 同时提供时须 `start_date` ≤ `end_date` |
## 执行方式
通过根目录的 `run.py` 调用(推荐):
```bash
python <RUN_PY> stk-code-change --trade_code 001872.SZ
python <RUN_PY> stk-code-change --trade_code 001872.SZ,920000.BJ --start_date 20180101 --end_date 20241231
```
> `<RUN_PY>` 为主 `SKILL.md` 同级的 `run.py` 绝对路径。
## 响应结构
```json
[
{
"trade_code": "001872.SZ",
"code": "1872",
"name": "招商港口",
"start_date": "20181226",
"end_date": null
},
{
"trade_code": "001872.SZ",
"code": "22",
"name": "招商港口",
"start_date": "19930505",
"end_date": "20181225"
}
]
```
### 字段说明
| 字段名 | 类型 | 是否可为空 | 说明 |
|-------------|--------|------------|-----------------------------------------------------------------------------------|
| trade_code | string | 否 | 该股票的最新代码(带 .SZ/.SH/.BJ 后缀) |
| code | string | 否 | 该时段内实际使用的股票代码(带后缀) |
| name | string | 否 | 股票名称 |
| start_date | string | 是 | 该代码开始使用的起始日期(`YYYYMMDD`;最早原代码之前可能为空字符串) |
| end_date | string | 是 | 该代码结束使用的日期(`YYYYMMDD`);`null` 表示当前仍在使用 |
## 注意事项
- `trade_code` 必填,为空时接口返回 400。
- 不分页,按 `trade_code` 返回该股票全部代码变更记录;多 `trade_code`(逗号分隔)时合并返回。
- 日期参数格式为 `YYYYMMDD`,非时间戳。
- 已上市股票的最早区间起始优先使用上市日期。
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!