According to AlphaMoat, as of 2026-10, 股票 has 51,509 downloads and 18 stars — ranked by downloads #480 among 10,914 AI skills in this ranking, and #47 of 915 in Data Analysis.
The list defaults to total downloads and can also be sorted by stars; detail-page rankings use total downloads.
| Platform | Downloads | Stars | Comments |
|---|---|---|---|
| ClawHub ↗ | 2.8K | 1 | - |
| SkillHub ↗ | 51.5K | 18 | — |
Platforms count differently and update at different times.
It covers real-time quotes, Chinese names, abbreviation and short-code conversion, capital flow, and daily candles, normalising Chinese names, abbreviations, or short codes into a full ths_code. The first call checks for and installs thsdk automatically, and when several stocks match it returns a candidate list to pick from. First use may automatically install or upgrade the third-party thsdk package. Some authenticated access may require THS username, password and MAC values.
Profile published 2026-10-27
Generated from the skill’s documentation as examples; not results of actual runs.
The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.
| Month | Downloads | MoM | Stars |
|---|---|---|---|
| 2026-10 | 51.5K | — | 18 |
| 2026-09 | 24.7K | — | 17 |
| 2026-08 | 18.1K | +16.7% | 17 |
| 2026-07 | 15.5K | — | 16 |
| 2026-05 | 12.0K | — | 13 |
| 2026-03 | 6.6K | — | - |
The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.
--- name: ths-financial-data description: 该skill用于获取股票市场数据,包括实时行情、中文名称查询、键盘缩写转换、资金流向和日K线数据。使用thsdk库提供同花顺数据接口支持。支持自动将中文、缩写、短代码转换为thsdk所需的完整ths_code格式。当匹配到多只股票时,会返回候选列表供用户选择。如未安装thsdk,会自动安装。 --- # Stock Data Skill ## 概述 此skill提供基于thsdk库的股票市场数据获取功能,支持A股、港股、美股等多市场数据查询。该skill应于用户需要获取金融市场数据、进行股票分析或构建金融应用时使用。
## 自动安装依赖
**此skill会自动处理 thsdk 库的安装**,无需用户手动操作:
```
首次使用时:
│
▼
检查 thsdk 是否安装?
│
┌────┴────┐
YES NO
│ │
▼ ▼
检查版本 自动执行
>= 1.7.14? pip install --upgrade thsdk
│
┌────┴────┐
YES NO
│ │
▼ ▼
正常使用 自动升级
```
如果检测到 thsdk 未安装或版本低于 1.7.14,会自动执行:
```bash
pip install --upgrade thsdk
```
## 代码自动解析工作流(核心规则)
**在任何需要股票代码的操作之前,必须先执行以下判断流程:**
```
用户输入的 stock_code
│
▼
是否满足"直通"条件?
USHA + 6位数字 (如 USHA600519,上交所A股)
USZA + 6位数字 (如 USZA000001,深交所A股)
│
┌────┴────┐
YES NO(短代码/中文/缩写/其他前缀/其他任何格式)
│ │
▼ ▼
直接使用 调用 search_symbols(input) 查询候选列表
│
▼
获取完整的 ths_code
│
┌─────┴─────┐
0条 1条 多条
│ │ │
▼ ▼ ▼
返回错误 自动匹配 筛选A股
"未找到" ths_code │
┌────┴────┐
0只A股 1只A股 多只A股
│ │ │
▼ ▼ ▼
展示全部 自动选择 返回候选列表
让用户选择 等待用户选择
```
## 多股票选择交互流程(重要)
当 `search_symbols` 匹配到**多只A股**时,函数会返回一个特殊结构:
```python
{
'need_selection': True,
'candidates': [
{'ths_code': 'USHA600520', 'name': '三佳科技', 'code': '600520', 'market': '沪A'},
{'ths_code': 'USZA002796', 'name': '世嘉科技', 'code': '002796', 'market': '深A'},
# ... 更多候选
],
'display': '\n**找到 5 只A股**:\n\n 1. **三佳科技** `USHA600520` (沪A)\n 2. **世嘉科技** `USZA002796` (深A)\n ...\n\n请输入序号选择(1-5),或输入 0 取消。'
}
```
**AI 助手应该:**
1. 检测返回值是否为 `dict` 且包含 `need_selection: True`
2. 将 `display` 内容展示给用户
3. 等待用户输入序号
4. 使用 `get_candidate_by_index(candidates, index)` 获取用户选择的股票
5. 使用获取到的 `ths_code` 继续后续操作
### 示例交互流程
```python
from thsdk import THS
from stock_utils import search_stock_candidates, get_candidate_by_index, get_kline_data
with THS() as ths:
# 第一步:搜索股票
result = search_stock_candidates(ths, "sjkj")
if result['status'] == 'found':
# 唯一匹配,直接使用
ths_code = result['ths_code']
df = ths.klines(ths_code, interval="day", count=30)
elif result['status'] == 'need_selection':
# 多个候选,需要用户选择
print(result['display']) # 展示给用户
# AI 应该在这里等待用户输入序号
# 假设用户选择了 2
user_choice = 2
selected = get_candidate_by_index(result['candidates'], user_choice)
if selected:
ths_code = selected['ths_code']
df = ths.klines(ths_code, interval="day", count=30)
elif result['status'] == 'not_found':
print(result['display']) # 未找到提示
```
---
## 快速开始
### AI 助手使用此 Skill 时
1. **自动安装检查**:首次调用时会自动检查并安装 thsdk
2. **获取 THS 实例**:可使用 `get_ths_instance()` 或直接 `from thsdk import THS`
3. **调用查询函数**:使用 `search_stock_candidates` 等函数获取数据
```python
# 方式1:使用便捷函数(推荐)
from stock_utils import get_ths_instance, get_kline_data
ths = get_ths_instance()
if ths:
df = get_kline_data(ths, "平安银行", interval="day", count=30)
# 方式2:标准方式
from thsdk import THS
from stock_utils import search_stock_candidates, get_kline_data
with THS() as ths:
result = search_stock_candidates(ths, "平安银行")
if result['status'] == 'found':
df = ths.klines(result['ths_code'], interval="day", count=30)
```
### 股票代码格式说明
thsdk 要求使用**完整 ths_code**,格式为市场前缀 + 代码:
| 市场 | 前缀 | 示例 |
|-----------|--------|----------------|
| 深交所A股 | `USZA` | `USZA000001` |
| 上交所A股 | `USHA` | `USHA600519` |
| 港股 | `HKHK` | `HKHK00700` |
| 美股 | `USUS` | `USUSAAPL` |
> **不需要手动记忆前缀**,使用 `search_stock_candidates()` 自动处理一切格式。
## 核心函数
### 1. ensure_thsdk() - 自动安装检查
```python
from stock_utils import ensure_thsdk, get_ths_instance
# 确保 thsdk 已安装
if ensure_thsdk():
print("thsdk 已就绪")
# 或直接获取实例(内部会自动检查安装)
ths = get_ths_instance()
```
### 2. search_stock_candidates(推荐)
搜索股票并返回结构化结果,支持优雅的用户选择流程:
```python
from thsdk import THS
from stock_utils import search_stock_candidates
with THS() as ths:
result = search_stock_candidates(ths, "ndsd")
# result['status'] 可能的值:
# - 'found': 唯一匹配,result['ths_code'] 可直接使用
# - 'need_selection': 多个候选,需要用户选择
# - 'not_found': 未找到匹配
# result['ths_code']: 唯一匹配时的 ths_code
# result['candidates']: 候选列表
# result['display']: 格式化的展示文本(直接展示给用户)
```
### 3. get_candidate_by_index
根据序号获取用户选择的股票:
```python
from stock_utils import get_candidate_by_index
# candidates 是 search_stock_candidates 返回的候选列表
# index 是用户输入的序号(1-based)
selected = get_candidate_by_index(candidates, 2)
if selected:
print(f"用户选择: {selected['name']} ({selected['ths_code']})")
```
### 4. get_kline_data
获取K线数据,支持自动解析股票代码:
```python
from thsdk import THS
from stock_utils import get_kline_data
with THS() as ths:
result = get_kline_data(ths, "平安银行", interval="day", count=30)
# 检查是否需要用户选择
if isinstance(result, dict) and result.get('need_selection'):
print(result['display']) # 展示候选列表给用户
# 等待用户选择...
elif isinstance(result, pd.DataFrame):
print(result) # 成功获取数据
else:
print("获取失败")
```
### 5. get_realtime_data
获取实时行情:
```python
from thsdk import THS
from stock_utils import get_realtime_data
with THS() as ths:
result = get_realtime_data(ths, "000001")
if isinstance(result, dict):
if result.get('need_selection'):
print(result['display']) # 需要选择
else:
print(f"股票:{result['name']}")
print(f"最新价:{result['price']}")
print(f"涨跌幅:{result['change_pct']}%")
```
### 6. get_fund_flow
获取资金流向:
```python
from thsdk import THS
from stock_utils import get_fund_flow
with THS() as ths:
result = get_fund_flow(ths, "贵州茅台")
if isinstance(result, dict) and not result.get('need_selection'):
print(f"主力净流入:{result['main_net_inflow']}")
print(f"散户净流入:{result['retail_net_inflow']}")
```
### 7. wencai_query
使用问财自然语言查询:
```python
from thsdk import THS
from stock_utils import wencai_query
with THS() as ths:
df = wencai_query(ths, "最近热度前50的行业和涨停原因归类")
if df is not None:
print(df.head())
```
## 完整使用示例
### 场景:用户输入模糊查询
```python
from thsdk import THS
from stock_utils import search_stock_candidates, get_candidate_by_index, get_kline_data
with THS() as ths:
# 用户输入:sjkj
result = search_stock_candidates(ths, "sjkj")
if result['status'] == 'need_selection':
# 展示候选给用户
print(result['display'])
# 输出示例:
# **找到 5 只A股**:
#
# 1. **三佳科技** `USHA600520` (沪A)
# 2. **盛剑科技** `USHA603324` (沪A)
# 3. **世嘉科技** `USZA002796` (深A)
# 4. **仕净科技** `USZA301030` (深A)
# 5. **熵基科技** `USZA301330` (深A)
#
# 请输入序号选择(1-5),或输入 0 取消。
# 等待用户选择序号
# user_choice = int(input("请选择: ")) # 假设用户输入 3
selected = get_candidate_by_index(result['candidates'], user_choice)
if selected:
ths_code = selected['ths_code']
df = ths.klines(ths_code, interval="day", count=30)
print(f"已获取 {selected['name']} 的日K线数据")
```
### 场景:唯一匹配(自动处理)
```python
from thsdk import THS
from stock_utils import search_stock_candidates, get_kline_data
with THS() as ths:
result = search_stock_candidates(ths, "ndsd")
if result['status'] == 'found':
# 自动匹配,无需用户选择
print(result['display']) # ✅ 已自动匹配:**宁德时代** `USZA300750` (深A)
df = ths.klines(result['ths_code'], interval="day", count=30)
print(df.head())
```
## 返回值说明
### search_stock_candidates 返回结构
| 字段 | 类型 | 说明 |
|------|------|------|
| `status` | str | `found` / `need_selection` / `not_found` |
| `ths_code` | str | 唯一匹配时的股票代码 |
| `candidates` | list | 候选股票列表 |
| `message` | str | 简短提示信息 |
| `display` | str | 格式化的展示文本(Markdown格式) |
### get_candidate_by_index 返回结构
```python
{
'ths_code': 'USZA002796',
'name': '世嘉科技',
'code': '002796',
'market': '深A'
}
```
## 输出格式
所有数据以表格形式输出,使用 Markdown 表格格式:
### 实时行情表格示例
| 代码 | 名称 | 最新价 | 涨跌幅 | 涨跌额 | 成交量 | 成交额 |
|------|------|--------|--------|--------|--------|--------|
| USZA000001 | 平安银行 | 15.20 | +1.23% | +0.18 | 12.5万 | 1.89亿 |
### 日K数据表格示例
| 日期 | 开盘 | 收盘 | 最高 | 最低 | 成交量 | 成交额 | 涨跌幅 |
|------|------|------|------|------|--------|--------|--------|
| 2026-03-13 | 27.34 | 27.02 | 27.80 | 26.90 | 372.9万 | 1.02亿 | -1.75% |
## 注意事项
1. **自动安装**:首次使用时会自动检查并安装 thsdk,无需手动操作
2. **数据延迟**:数据来源于同花顺,实时数据可能存在短暂延迟
3. **请求频率**:避免短时间内大量请求,每次查询间隔建议 > 100ms
4. **股票代码格式**:只有 `USHA/USZA + 6位数字` 可以直通,其他格式都会先查询
5. **用户选择**:多只A股时必须等待用户选择,不能自动选择第一只
6. **港股/美股**:港股和美股代码会通过 `search_symbols` 查询确认
## 工具函数
### 安装检查函数
```python
from stock_utils import check_thsdk_installed, get_thsdk_version, ensure_thsdk
# 检查是否已安装
is_installed = check_thsdk_installed() # True/False
# 获取当前版本
version = get_thsdk_version() # "1.7.14" 或 "not installed"
# 确保已安装(未安装则自动安装)
ensure_thsdk() # 返回 True/False
```
## 资源文件
- `scripts/stock_utils.py` — 核心工具函数,包含自动安装、search_stock_candidates 自动解析及所有数据获取封装
- `references/api_reference.md` — thsdk 原始 API 完整参考文档
- `assets/stock_template.py` — 含可视化的股票分析完整模板
中国金融机构数据爬取与分析综合 Skill v12.0.0。2334家/43大类机构名单、60+财经媒体源舆情、 A股报告/公告/研报、60+种查询多源金融数据(自动降级+缓存)、爬取调度与网页操作增强、 实时数据中枢、24 技术指标引擎、多源证据融合、110 MCP 工具 + 10 Resource + 14 Prompt。 🆕 v12.0.0 四条线(信息获取 / 打包下载 / 数据分析 / 登录): 编排:gather_info() 一次跑完"路由→抓取→去占位→质量分→能力边界→回执→打包", 8 类意图各带问法、输入输出、典型耗时与 not_for(说清哪件事做不了)。 诚实:反爬占位条目一律剔除并记账,空结果报 E_SOURCE_EMPTY,不把假数据判成 B 级成功。 交付:包内自带 manifest.json(逐文件 sha256),verify 查得出改动/缺失/多塞, 批量下载单条失败不中断整批,失败清单可直接只重下那几条。 登录:Cookie 由用户导出或扫码接管,档案化 + 健康度四档,对外输出全脱敏(值永不回显)。 何时触发:爬取机构、舆情爬取、东方财富、公告下载、实时行情、技术指标、统一查询、 交付包、批量重下、我已经登录了、登录态还有效吗(完整触发词见下方 auto_trigger)。
大宗商品价格数据查询技能。用于查询大宗商品期现货价格、宏观经济指标、产业链供需数据、进出口库存数据、金融市场数据等。当用户询问:(1) 期货/现货价格查询,如"螺纹钢价格"、"铜期货收盘价"; (2) 历史行情或趋势分析;(3) 区域或企业价格对比;(4) 宏观经济指标,如GDP、CPI;(5) 产业链上下游数据;(6) 多市场金融数据(期权、股票、债券、外汇);(7) 结算确认单生成时触发此技能。
将数据文件(CSV/TSV/TXT/XLSX/XLS/JSON)转化为独立交互式 ECharts HTML 图表——32 类图表、3 套主题,全离线无需 CDN。出图前可先取数据画像(--profile:每列 dtype/基数/缺失/样本/统计、实体粒度、候选洞察信号、疑似非数据行),让 agent 在用户没说想看什么时自己读懂数据并决定出什么图——哪列是 ID、哪列是维度、出什么图,全部由 agent 从画像的客观事实自行判断,技能不代笔;每张图内置事实卡(plot_stats + data_preview),其数值是解读时唯一可引用的数字。本技能负责出图与算事实,不产出书面报告或叙事文档。触发:用户提供或指向表格数据文件并要求出图;提到「画图/出图/可视化/生成图表/generate a chart/make a graph」;想把表格渲染成交互式 HTML 图表。不触发:要的是书面报告、叙事分析或幻灯片;没有数据文件;需要后端的仪表盘;图片/音频/视频等非表格内容。
The data layer for AdMapix: turn ad and app queries into API calls that return raw JSON only.
论文配图一键生成:一条命令从 JSON/CSV/Excel 生成顶刊级学术图表,科研绘图 与期刊配图全场景覆盖。40 种图表(森林图/KM 生存曲线(自动风险表)/竞争风险累计发生率/ROC/校准 曲线/决策曲线 DCA/列线图/RCS 非线性剂量反应/亚组分析森林图/RMST 限制平均生存时间/Galbraith 径向图/火山图/雨云图/山脊图/哑铃图/游泳图(逐例时长+里程碑)/ 肿瘤缓解瀑布图/UpSet 交集/PRISMA 流程图/漏斗/BA 一致性/PCA/热图/箱线/小提琴/ 组合图/Cox 多因素回归森林图等),9 套配色(含色盲安全 Okabe-Ito 与期刊色板),9 种期刊投稿预设, YAML 流水线一条命令出全套论文图,一次渲染多格式导出(TIFF/PNG/PDF), PDF 重叠门禁,600dpi。纯本地运行,数据不出机,中文零配置。适用:写论文/ 投稿要配图、把数据变成可投稿图表、批量重出全套图。不适用:文本润色/翻译/ 改写(请用写作类工具);商业报表/仪表盘/海报装饰;无数据支撑的纯示意图。
Intelligent chart generation and data analysis skill. Reads user-supplied data files (CSV/Excel/JSON), analyzes data characteristics with LLM assistance, auto-recommends and generates interactive ECharts visualizations. Use when the user asks to analyze data, generate charts, create visualizations, or work with tabular data files.
全球智能投研工具(stock-researcher)v13.0:多源数据 + 概率预测 + 可导出报告。 核心能力: - 多源数据路由:按市场/类别选源,逐级降级;每个结果标注来源与时效等级;源不可用时明确标 unavailable - 全资产量化:股票/ETF/场外基金/指数/期货(期限结构、基差、持仓、折溢价)多因子分析 - 概率预测:1d/5d/1M/3M/6M 经验分布 + 分位数 + 方向概率 + 区间,kNN 邻域收缩融合全局分布; 样本不足自动弃权,可按历史命中样本(同桶)做概率校准 - 证据链简报:每条结论绑定来源、时间与数据质量,冲突信号保留而不抹平 - 报告导出:Word/PPT/PDF/Markdown/JSON/纯文本,纯标准库渲染 + 可选第三方引擎 - MCP Server 24 工具,Claude Code 可直接调用;知识库 12 适配器双向同步 三条铁律: - 数据不装:拿不到就报不可用,不拿 0 价、不拿空表冒充 - 预测不装:概率来自历史相似条件的经验分布,样本不足就说不足,不硬给方向 - 评分≠盈利保证:任何结论都带免责声明
Searches the public web through Tavily and returns structured results with links and snippets.
Advanced China-market stock analysis using thsdk.
A skill that fetches intraday series for A-shares and indices.
同花顺智能选ETF skill。根据行情、跟踪指数基本面、规模、风格类型等条件筛选ETF。返回符合条件的相关ETF数据。当用户询问ETF筛选问题时,必须使用此技能。
Data as of 2026-10. Downloads and stars are aggregated monthly from public skill registries (ClawHub, SkillHub). See data methodology.