← 返回 Skills 市场
491
总下载
1
收藏
6
当前安装
3
版本数
在 OpenClaw 中安装
/install akshare-cn-market
功能描述
中国A股行情与宏观经济数据工具,基于 AKShare 库。支持个股K线、大盘指数、财务摘要、GDP/CPI/PMI/M2货币供应、中美国债收益率等。
使用说明 (SKILL.md)
AKShare 中国市场数据
安装依赖
pip install akshare pandas
# 验证
python3 -c "import akshare; print(akshare.__version__)"
脚本用法
股票行情(scripts/stock.py)
# 个股历史K线(默认最近10条日线,前复权)
python3 scripts/stock.py hist 000001
python3 scripts/stock.py hist 600519 --n 20 --start 20240101
# 大盘指数K线(新浪源)
python3 scripts/stock.py index sh000001 # 上证综指
python3 scripts/stock.py index sh000300 # 沪深300
python3 scripts/stock.py index sz399001 # 深证成指
python3 scripts/stock.py index sh000016 --n 5 # 上证50,最近5条
# 个股财务摘要(近5年)
python3 scripts/stock.py financial 000001
python3 scripts/stock.py financial 600519
宏观数据(scripts/macro.py)
# GDP 季度数据(默认最近8季度)
python3 scripts/macro.py gdp
python3 scripts/macro.py gdp --n 4
# CPI 月度数据(默认最近12个月)
python3 scripts/macro.py cpi
# PMI(制造业 + 非制造业,默认最近12个月)
python3 scripts/macro.py pmi
# 货币供应量 M0/M1/M2(默认最近12个月)
python3 scripts/macro.py money
# 中美国债收益率(默认最近10个交易日)
python3 scripts/macro.py bond --n 5
交易日历(scripts/trade_cal.py)
# 判断今天是否为交易日
python3 scripts/trade_cal.py check today
# 判断指定日期
python3 scripts/trade_cal.py check 2026-03-01
# 当天或之后最近的交易日
python3 scripts/trade_cal.py next today
python3 scripts/trade_cal.py next 2026-02-01
# 当天或之前最近的交易日(获取最近一个收盘日)
python3 scripts/trade_cal.py prev today
# 列出区间内所有交易日
python3 scripts/trade_cal.py range 2026-03-02 2026-03-06
数据来源:新浪财经,覆盖 1990-12-19 至 2026-12-31。
在 Agent 中直接调用
import akshare as ak
# A股个股K线
df = ak.stock_zh_a_hist(symbol="000001", period="daily", start_date="20240101", adjust="qfq")
# 大盘指数(新浪源,不受东方财富代理限制)
df = ak.stock_zh_index_daily(symbol="sh000001")
# 宏观:GDP / CPI / PMI / 货币供应
df = ak.macro_china_gdp()
df = ak.macro_china_cpi()
df = ak.macro_china_pmi()
df = ak.macro_china_money_supply()
# 中美国债收益率
df = ak.bond_zh_us_rate()
# 交易日判断(覆盖至2026年底)
from scripts.trade_cal import is_trade_day, next_trade_day, prev_trade_day
if not is_trade_day("2026-03-02"):
print("非交易日,跳过")
last_close = prev_trade_day("2026-03-02") # 最近一个收盘日
# 个股财务摘要(同花顺)
df = ak.stock_financial_abstract_ths(symbol="000001", indicator="按年度")
返回格式
所有脚本输出均为 JSON 数组(每条记录一个对象)。
常用指数代码
| 代码 | 指数 |
|---|---|
| sh000001 | 上证综指 |
| sz399001 | 深证成指 |
| sh000300 | 沪深300 |
| sh000016 | 上证50 |
| sh000905 | 中证500 |
超短复盘专用接口(已验证可用)
情绪数据
# 涨停板池(含连板数、封板时间、炸板次数)
df = ak.stock_zt_pool_em(date="20260302") # 格式 YYYYMMDD
# 字段: 代码, 名称, 涨跌幅, 换手率, 封板资金, 首次封板时间, 炸板次数, 连板数, 所属行业
# 强势股池(60日新高 + 涨停候选)
df = ak.stock_zt_pool_strong_em(date="20260302")
# 跌停板池
df = ak.stock_zt_pool_dtgc_em(date="20260302")
# 昨日涨停(用于次日跟踪)
df = ak.stock_zt_pool_previous_em(date="20260302")
龙虎榜
# 龙虎榜明细(含游资席位、净买额)
df = ak.stock_lhb_detail_em(start_date="20260302", end_date="20260302")
# 字段: 代码, 名称, 涨跌幅, 龙虎榜净买额, 上榜原因, 上榜后1/2/5/10日
# 游资席位统计
df = ak.stock_lhb_traderstatistic_em(period="近一月")
资金流向
# 全市场主力资金流向(历史,按日)
df = ak.stock_market_fund_flow()
# 字段: 日期, 主力净流入-净额, 超大单净流入-净额, 大单净流入-净额
# 板块资金流向排名
df = ak.stock_sector_fund_flow_rank(indicator="今日", sector_type="概念资金流向")
df = ak.stock_sector_fund_flow_rank(indicator="今日", sector_type="行业资金流向") # 可能代理受限
北向资金
# 北向资金历史(沪深300同步)
df = ak.stock_hsgt_hist_em(symbol="北向资金")
# 字段: 日期, 当日成交净买额, 持股市值, 领涨股, 沪深300-涨跌幅
# ⚠️ 当日成交净买额近期可能为 nan(数据源问题),用持股市值环比估算
⚠️ 网络限制说明
| 接口类型 | 可用性 | 说明 |
|---|---|---|
| 新浪源指数K线 | ✅ 稳定 | stock_zh_index_daily |
| 涨停板池/龙虎榜 | ✅ 稳定 | 东方财富历史数据接口 |
| 主力资金流向历史 | ✅ 稳定 | stock_market_fund_flow |
| 北向资金历史 | ✅ 可用(部分字段nan) | stock_hsgt_hist_em |
| 板块实时排行 | ❌ 代理受限 | 东方财富push接口被SSRF策略拦截 |
注意事项
- 数据来源:公开财经网站,仅供研究参考
- 网络要求:新浪源指数 + 历史数据接口稳定;东方财富 push 实时接口在 sandbox 被代理拦截
- 数据延迟:日线数据次日可用;实时行情不可用
- 投资风险:数据仅供参考,投资决策请自行判断
安全使用建议
This skill appears coherent and limited to fetching public market/macro data via the akshare Python library. Before installing: (1) run pip install in a controlled Python environment (virtualenv) to avoid contaminating system packages; (2) be aware akshare will make outbound HTTP requests to public finance sites (these requests may be visible in network logs and subject to sandbox/proxy restrictions); (3) verify you trust the akshare package version you install (review upstream project and changelog) and be mindful of rate limits or scraping-related legal/usage terms if you use data for heavy or commercial use; (4) do not expect real-time trading-grade latency — the README warns some real-time endpoints are proxy/blocked in sandboxes and data is for research only.
功能分析
Type: OpenClaw Skill
Name: akshare-cn-market
Version: 1.2.0
The skill bundle provides tools for Chinese A-share market and macroeconomic data using the AKShare library. All Python scripts (`macro.py`, `stock.py`, `trade_cal.py`) handle user inputs safely via `argparse` and pass them as direct parameters to `akshare` functions or perform safe parsing/validation (e.g., `datetime.strptime`). There is no evidence of shell/code injection, data exfiltration, persistence mechanisms, or obfuscation. The `SKILL.md` instructions are clear and do not contain any prompt injection attempts or directives for malicious actions. All observed behaviors are aligned with the stated purpose of fetching financial data from legitimate sources.
能力评估
Purpose & Capability
The name/description (AKShare CN Market) match the included scripts and SKILL.md. The scripts call akshare functions to fetch stock K-lines, indices, macro data, bond rates and trade-calendar info — all consistent with the described functionality.
Instruction Scope
Runtime instructions are limited to installing akshare/pandas, running the provided scripts, or importing akshare in-agent. The instructions do not ask the agent to read local secrets, unrelated files, or transmit data to unexpected endpoints. Network access to public finance data sources is expected and documented.
Install Mechanism
No custom install spec is embedded; SKILL.md recommends 'pip install akshare pandas' which is a standard PyPI workflow. There are no downloads from untrusted URLs or archive extraction in the skill itself.
Credentials
The skill declares no required environment variables, credentials, or config paths. The scripts do not reference secrets or external credentials; they only call akshare APIs that fetch public data.
Persistence & Privilege
The skill is not forced-always, does not modify other skills or system-wide settings, and requests no persistent privileges. Agent autonomous invocation is allowed (platform default) but not combined with other red flags.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install akshare-cn-market - 安装完成后,直接呼叫该 Skill 的名称或使用
/akshare-cn-market触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.0
新增超短复盘专用接口文档:涨停池/强势股池/跌停池/龙虎榜/主力资金流向/北向资金;补充网络限制说明(东方财富push接口在sandbox受SSRF限制)
v1.1.0
新增交易日历工具(trade_cal.py):判断是否交易日、获取上/下一交易日、列出区间内交易日;修复 datetime.date 类型匹配 bug
v1.0.0
初始版本
元数据
常见问题
AKShare CN Market 是什么?
中国A股行情与宏观经济数据工具,基于 AKShare 库。支持个股K线、大盘指数、财务摘要、GDP/CPI/PMI/M2货币供应、中美国债收益率等。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 491 次。
如何安装 AKShare CN Market?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install akshare-cn-market」即可一键安装,无需额外配置。
AKShare CN Market 是免费的吗?
是的,AKShare CN Market 完全免费(开源免费),可自由下载、安装和使用。
AKShare CN Market 支持哪些平台?
AKShare CN Market 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 AKShare CN Market?
由 Eski Yin(@geoion)开发并维护,当前版本 v1.2.0。
推荐 Skills