同花顺官方 A股金融数据服务,提供股票实时行情、历史行情、财务报表、指数、板块、涨停等数据,适用于 AI Agent、量化研究和应用开发,支持 API、MCP、CLI 和 Python。Official Tonghuashun (HiThink) A-share financial data service providing real-time and historical stock market data, financial statements, indices, sectors and limit-up data for AI agents, quantitative research and application development.
# Add to your Claude Code skills
git clone https://github.com/Hithink-Tech-Org/Financial-APIGuides for using ai agents skills like Financial-API.
See how Financial-API compares with popular alternatives.
Financial-API is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by Hithink-Tech-Org. 同花顺官方 A股金融数据服务,提供股票实时行情、历史行情、财务报表、指数、板块、涨停等数据,适用于 AI Agent、量化研究和应用开发,支持 API、MCP、CLI 和 Python。Official Tonghuashun (HiThink) A-share financial data service providing real-time and historical stock market data, financial statements, indices, sectors and limit-up data for AI agents, quantitative research and application development. It has 4,128 GitHub stars.
Financial-API's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/Hithink-Tech-Org/Financial-API" and add it to your Claude Code skills directory (see the Installation section above).
Financial-API is primarily written in TypeScript. It is open-source under Hithink-Tech-Org on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh Financial-API against similar tools.
No comments yet. Be the first to share your thoughts!
Available after the catalog security scan passes.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
See comparison
同花顺金融数据服务(hithink-finance) 是由同花顺官方提供和维护的 A 股金融数据服务,面向 AI Agent、量化研究者和应用开发者。
通过统一 API Key,可以查询 A 股行情、集合竞价、财务报表、估值、指数与板块、公募基金、公开期货期权、特色数据及 A 股和港股新股资料,并通过 REST API、MCP、CLI、Python SDK、本地 DuckDB 或 Agent Skill 接入现有工作流。
一站式同花顺官方金融数据能力,覆盖查询、研究、批量导出和 AI Agent 自动调用。
docs/API、MCP、CLI、Python SDK 和 Agent Skill 适合自主接入;同花顺AI客户端已接入当前数据源,金融数据与分析能力已内置,打开客户端即可使用。
| 使用场景 | 推荐方式 | 说明 |
|---|---|---|
| 让 AI Agent 自动查询和分析金融数据 | CLI 内置 Skills | 根据各内置 Skill 的 description 直接选择业务域 |
| 在终端、Agent 或自动化任务中统一取数和导出 | CLI | 整合远端取数、本地 DuckDB、认证和结构化输出 |
| 在 Chat Bot 或 IDE 中直接调用 | MCP | 配置托管服务和 API Key 后在对话中使用 |
| 接入网站、App、后台服务或其他语言 | REST API | 标准 HTTP 接口,适合自定义集成 |
| 在 Python、Notebook 或研究流程中使用 | Python SDK | 适合数据处理、自定义分页和研究脚本 |
| 长期维护历史行情并使用 SQL 研究 | marketdb | 本地构建和增量维护 DuckDB 数据库 |
| 获取全市场或长时间范围数据 | CLI / Market Dumps | 使用批量能力并让大结果直接落盘 |
| 免配置使用金融数据或端内专用能力 | 同花顺AI客户端 | 数据源已经接入,打开客户端即可使用 |
Agent 和终端任务优先使用 CLI 及其内置 Skills;REST 文档与 HTTP 接口选路使用 hithink-finance,MCP 配置及工具调用使用 hithink-finance-mcp。
| 数据 / 能力 | 主要用途 | 推荐入口 |
|---|---|---|
| 标的目录 | 根据名称、代码或关键词查找唯一 thscode |
CLI / API / MCP / Python |
| A 股最新行情 | 查询单只、多只或全市场股票的最新价格与交易数据 | CLI / API / MCP / Python |
| A 股历史 K 线 | 获取历史走势,用于研究、回测和趋势分析 | CLI / marketdb |
| 集合竞价 | 查询竞价实时或终态快照与短期强弱基准 | CLI / API / MCP / Python |
| 公司行动与复权 | 查询分红、送转等公司行动并生成复权数据 | CLI / marketdb |
| 财务报表与指标 | 查询利润表、资产负债表、现金流量表和财务指标 | CLI / API / MCP / Python |
| A 股估值快照 | 批量查询市盈率、市净率、市销率和市现率 | CLI / API / MCP / Python |
| 交易日历 | 判断交易日并安排数据同步或研究窗口 | CLI / API / MCP / Python |
| 指数与板块 | 查询目录、成分股、快照和历史行情 | CLI / API / MCP / Python |
| 特色数据 | 查询涨跌停、炸板、连板、异动、热榜和龙虎榜 | CLI / API / MCP / Python |
| 公募基金 | 查询资料、公司、经理、财务、持仓、净值、业绩、资讯和场内行情 | CLI / API / MCP / Python |
| 公开期货 | 查询品种、合约、持仓、仓单、基差、交易日程、分时和日 K | CLI / API / MCP / Python |
| 公开期权 | 查询品种、合约、分时和日 K | CLI / API / MCP / Python |
| 资讯 | 查询资讯详情、快讯、公告解读、专题、日期范围异动解读与个股分时新闻 | CLI / API / MCP / Python |
| 全市场数据文件 | 下载全量或增量日 K、公司行动等标准数据文件 | CLI / Market Dumps |
| 本地 DuckDB | 初始化、同步、校验、修复、SQL 查询和导出 | CLI / marketdb |
| 端内专用数据与分析 | 在客户端使用资金流向、高频动向和期货期权专业数据 | 同花顺AI客户端 |
当前公开方式不提供分钟 K、tick、Level-2、港股或美股行情、宏观数据、新闻公告原文、研报原文、基金申赎交易和投资推荐。标记为“端内专用”的能力已内置于同花顺AI客户端,不通过公开 API、MCP、CLI 或 Python SDK 提供。数据权限及实际可访问能力以官网和账号授权为准;请求未支持的数据时,不使用模拟数据或静态示例冒充真实结果。
CLI 默认推荐 OAuth:先运行 hithink-finance auth status --format json 复用当前有效凭据;首次登录使用 hithink-finance auth login --method oauth,按提示完成浏览器授权。
REST、MCP、Python 及 CLI 的 API Key 方式共用在 API Key 管理 获取的 Key。选择此方式后,Agent 可完成 Key 签发、安全交接、用户级持久配置和真实请求验证。具体流程见 API Key 创建与持久配置。
用户可以直接把 API Key 提供给 Agent 上下文以便代配;Agent 不应复述,并应提示聊天平台可能保留消息记录。Key 不要写入代码、README、Issue、日志、产物或 Git;本地持久化优先使用用户级环境变量、用户级凭据文件、系统凭据库或客户端 Secret。
按实际接入方式使用独立 Skill:
| Skill | 职责 |
|---|---|
hithink-finance |
REST API Wiki 与 API Router:接口文档、HTTP 接口选择、参数和返回字段契约,附带 CLI 简介、安装准备与首次接入 |
hithink-finance-mcp |
MCP 配置与连接、业务域和 tool 选路、单工具参数与返回要求 |
各自安装或分发时保留完整目录及 references/。MCP 契约按业务分类组织,每个工具保留包含参数、返回字段和关联结构的独立小节,可以独立使用。
CLI 配套领域 Skills 随 npm 包安装,并由 CLI 发布到用户级共享目录,再链接到已安装 Agent:
npm install -g @hithink-tech/hithink-finance-cli
hithink-finance skills status --format json
CLI 的业务请求由宿主按内置 Skill 的 description 直接选择领域。CLI 配套 Skills 的同步规则见 CLI 文档。
重新打开 Agent 会话后即可直接描述需求:
查询贵州茅台的最新行情,并分析近一年的涨跌幅、最大回撤和均线趋势。
CLI 是人类终端、Agent 和自动化任务的默认推荐入口:
npm install -g @hithink-tech/hithink-finance-cli
hithink-finance auth login
hithink-finance capabilities --format json
常见命令:
# 根据代码或名称查找股票
hithink-finance symbol search --q 600519 --limit 5 --format json
# 查询最新行情
hithink-finance market snapshot --thscodes 600519.SH --format json
# 查询最近四期利润表
hithink-finance financials income --thscode 600519.SH --limit 4 --format json
# 初始化本地数据库
hithink-finance data init --format json
# 查询本地前复权日线
hithink-finance db query \
--sql "SELECT * FROM v_daily_qfq LIMIT 10" \
--format json
CLI 会为已检测到的 Agent 同步配套领域 Skills。支持目标、自定义目录、修复、移除和手工兜底安装方式见 CLI Skills 管理说明。
仅在参与仓库开发或 npm 暂不可用时从源码验证:
cd hithink-finance-cli
npm ci --ignore-scripts
npm run build
node dist/cli/main.js capabilities --format json
完整命令和生命周期说明见 hithink-finance-cli/README.md。
REST API 适合服务端、自定义语言和零依赖 HTTP 集成。以下示例查询贵州茅台最新行情:
curl 'https://fuyao.aicubes.cn/api/a-share/prices/snapshot?thscodes=600519.SH' \
-H 'X-api-key: <API_KEY>'
docs/api/ 按业务域提供单接口页与多接口模块页;字段、参数和错误语义以目标接口小节为准。
MCP 适合 Claude Desktop、Cursor、Windsurf 和其他支持 MCP 的客户端。按七个数据域提供接入配置,连接后以实时 tools/list 确认可用工具:
| 服务名称 | 地址 | 主要能力 |
|---|---|---|
hithink-finance-a-share |
https://fuyao.aicubes.cn/mcp/a-share |
A 股行情、财务、估值、竞价和特色数据 |
hithink-finance-a-share-index |
https://fuyao.aicubes.cn/mcp/a-share-index |
指数、板块、成分和行情 |
hithink-finance-meta |
https://fuyao.aicubes.cn/mcp/meta |
标的检索和能力发现 |
hithink-finance-fund |
https://fuyao.aicubes.cn/mcp/fund |
公募基金资料、披露、净值、收益和场内行情 |
hithink-finance-futures |
https://fuyao.aicubes.cn/mcp/futures |
公开期货资料、持仓、基差、日程和行情 |
hithink-finance-options |
https://fuyao.aicubes.cn/mcp/options |
公开期权品种、合约和行情 |
hithink-finance-hk-share |
https://fuyao.aicubes.cn/mcp/hk-share |
港股新股递表、认购、上市日历与发行详情 |
单个服务的配置结构如下:
{
"mcpServers": {
"hithink-finance-a-share": {
"type": "http",
"url": "https://fuyao.aicubes.cn/mcp/a-share",
"headers": {
"X-api-key": "${HITHINK_FINANCE_API_KEY}"
}
}
}
}
完整配置、安全方式、服务路由和验证步骤见 MCP 接入说明。实际调用或排查参数变化时,以当前连接返回的 tools/list 为准。
安装 Python 子项目:
python -m pip install -e ./python
查询远端数据:
python python/toolkit/fuyao/scripts/fuyao.py tickers-search --q "贵州茅台"
python python/toolkit/fuyao/scripts/fuyao.py prices-snapshot --thscodes 600519.SH
初始化并检查本地数据库:
python python/bootstrap.py
marketdb status --json --db data/market.duckdb
marketdb validate --json --db data/market.duckdb
更多说明:
examples/inspirations/ 提供可以复制使用的 Prompt、预览图和静态 HTML;python/examples/ 提供 SDK、marketdb 和远端数据组合示例。
该示例组合展示最新行情、近一年日 K、均线、区间表现和最大回撤。
示例用于说明数据组合方式,不是数据能力契约、投资建议或固定视觉标准。
thscode,不要猜测交易所或指数后缀。项目对外可见的重要变化按时间倒序记录在 CHANGELOG.md,避免在多个入口重复维护易过期的版本摘要。
旧版根级 Python 用户、脚本和 Agent Prompt 请先阅读 Monorepo 版本升级指南;本地数据库和数据文件不需要随代码目录迁移。
docs/ 公共文档中心;REST 与 MCP 契约和接入说明
skills/hithink-finance/ 可独立安装的统一 Agent Skill;包含契约镜像
hithink-finance-cli/ Node.js CLI 子项目,运行时不依赖 Python
python/ Python SDK、远端 toolkit、marketdb、示例和测试
examples/ monorepo 级示例导航和静态灵感
scripts/ 仓库级维护脚本
详细参数和契约下沉到对应子项目 README 或 docs/。REST 页面同步到 hithink-finance;MCP 工具按业务分类合并到 hithink-finance-mcp,每个工具小节包含参数、返回字段和关联结构。契约更新后从仓库根目录运行:
python scripts/sync_skill_contracts.py
python scripts/sync_skill_contracts.py --check
python -m pytest python/tests/
cd hithink-finance-cli
npm run verify
internal/ 和 sdd-docs/ 属于内部治理与开发记录,不是公开使用入口。
本仓库采用 MIT License。