← 返回 Skills 市场
xiaobenyang-com

股票数据接口服务

作者 xiaobenyang-com · GitHub ↗ · v1.0.7 · MIT-0
cross-platform ✓ 安全检测通过
67
总下载
0
收藏
0
当前安装
8
版本数
在 OpenClaw 中安装
/install akshare-one
功能描述
基于akshare-one的MCP服务器,提供中国股票市场数据的全面接口,包括历史数据、实时数据、新闻数据和财务报表等金融信息。
使用说明 (SKILL.md)

股票数据接口服务

基于akshare-one的MCP服务器,提供中国股票市场数据的全面接口,包括历史数据、实时数据、新闻数据和财务报表等金融信息。


⚠️ 强制要求:API 密钥

此 Skill 必须配置 API 密钥才能使用。

  • 首次使用时,如果 .env 中没有 XBY_APIKEY必须使用 AskUserQuestion 工具向用户询问 API 密钥
  • 拿到用户提供的密钥后,调用 scripts.config.set_api_key(api_key) 保存,然后继续处理
  • 获取 API 密钥:https://xiaobenyang.com
  • 禁止在缺少 API 密钥时自行搜索或编造数据

工作流程(必须遵守)

你(大模型)是路由层,负责理解用户意图、选择工具、提取参数。代码只负责调用API。

用户输入 → 你选择工具 → 提取该工具需要的参数 → 调用 scripts.tools 中的函数 → 返回结果给用户

步骤

  1. 检查 API 密钥:如果 scripts.config.settings.api_key 为空,使用 AskUserQuestion 询问用户,拿到后调用 scripts.config.set_api_key(key) 保存
  2. 选择工具:根据用户意图从下方工具列表中选择对应的工具函数
  3. 提取参数:根据选中的工具,提取该工具需要的参数
  4. 调用工具:使用关键字参数调用 scripts.tools 中的函数,例如 scripts.tools.search_schools(score='520', province='北京', category='综合')
  5. 返回结果:将工具返回的 raw 数据整理后展示给用户

工具选择规则

根据用户意图选择对应的工具函数:

用户意图 工具函数
Get historical stock market data. 'eastmoney_direct' support all A,B,H shares scripts.tools.get_hist_data
Get real-time stock market data. 'eastmoney_direct' support all A,B,H shares scripts.tools.get_realtime_data
Get stock-related news data. scripts.tools.get_news_data
Get company balance sheet data. scripts.tools.get_balance_sheet
Get company income statement data. scripts.tools.get_income_statement
Get company cash flow statement data. scripts.tools.get_cash_flow
Get company insider trading data. scripts.tools.get_inner_trade_data
Get key financial metrics from the three major financial statements. scripts.tools.get_financial_metrics
Get current time with ISO format, timestamp, and the last trading day. scripts.tools.get_time_info

如果参数不完整,使用 AskUserQuestion 向用户询问缺失的参数。


工具函数说明


scripts.tools.get_hist_data

工具描述:Get historical stock market data. 'eastmoney_direct' support all A,B,H shares

参数定义

参数名称 参数类型 是否必填 默认值 描述
symbol string true Stock symbol/ticker (e.g. '000001')
interval string false "day" Time interval
interval_multiplier integer false 1.0 Interval multiplier
start_date string false "1970-01-01" Start date in YYYY-MM-DD format
end_date string false "2030-12-31" End date in YYYY-MM-DD format
adjust string false "none" Adjustment type
source string false "eastmoney" Data source
indicators_list null false Technical indicators to add
recent_n null false 100.0 Number of most recent records to return

scripts.tools.get_realtime_data

工具描述:Get real-time stock market data. 'eastmoney_direct' support all A,B,H shares

参数定义

参数名称 参数类型 是否必填 默认值 描述
symbol null false Stock symbol/ticker (e.g. '000001')
source string false "eastmoney_direct" Data source

scripts.tools.get_news_data

工具描述:Get stock-related news data.

参数定义

参数名称 参数类型 是否必填 默认值 描述
symbol string true Stock symbol/ticker (e.g. '000001')
recent_n null false 10.0 Number of most recent records to return

scripts.tools.get_balance_sheet

工具描述:Get company balance sheet data.

参数定义

参数名称 参数类型 是否必填 默认值 描述
symbol string true Stock symbol/ticker (e.g. '000001')
recent_n null false 10.0 Number of most recent records to return

scripts.tools.get_income_statement

工具描述:Get company income statement data.

参数定义

参数名称 参数类型 是否必填 默认值 描述
symbol string true Stock symbol/ticker (e.g. '000001')
recent_n null false 10.0 Number of most recent records to return

scripts.tools.get_cash_flow

工具描述:Get company cash flow statement data.

参数定义

参数名称 参数类型 是否必填 默认值 描述
symbol string true Stock symbol/ticker (e.g. '000001')
source string false "sina" Data source
recent_n null false 10.0 Number of most recent records to return

scripts.tools.get_inner_trade_data

工具描述:Get company insider trading data.

参数定义

参数名称 参数类型 是否必填 默认值 描述
symbol string true Stock symbol/ticker (e.g. '000001')

scripts.tools.get_financial_metrics

工具描述:Get key financial metrics from the three major financial statements.

参数定义

参数名称 参数类型 是否必填 默认值 描述
symbol string true Stock symbol/ticker (e.g. '000001')
recent_n null false 10.0 Number of most recent records to return

scripts.tools.get_time_info

工具描述:Get current time with ISO format, timestamp, and the last trading day.

参数定义

参数名称 参数类型 是否必填 默认值 描述


返回值处理

工具函数返回 dict 对象:

  • result["raw"] - API 原始返回数据(JSON),直接将此数据整理后展示给用户
  • result["success"] - 是否成功(True/False)
  • result["message"] - 状态消息

项目结构

xiaobenyang_gaokao_skill/
├── scripts/
│   ├── __init__.py
│   ├── config.py       # 配置管理 + set_api_key()
│   ├── call_api.py      # API 客户端 + call_api()
│   └── tools.py         # 工具函数(直接调用)
├── requirements.txt
└── SKILL.md

注意事项

  1. API 密钥是必需的,无密钥时必须通过 AskUserQuestion 询问用户
  2. 禁止在缺少 API 密钥时自行搜索或编造数据
安全使用建议
Treat this as an incomplete review: the local artifact inspection failed, and no security conclusion beyond absence of reviewed evidence should be relied on until metadata.json and artifact contents are readable.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
Artifact contents were unavailable due local command execution failure, so purpose and capability coherence could not be verified.
Instruction Scope
SKILL.md could not be read, so runtime instruction scope could not be assessed from artifact evidence.
Install Mechanism
metadata.json and install artifacts could not be read, so install behavior could not be assessed from artifact evidence.
Credentials
No artifact evidence was available to evaluate whether requested environment access is proportionate.
Persistence & Privilege
No artifact evidence was available to evaluate persistence or privilege behavior.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install akshare-one
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /akshare-one 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.7
- No changes detected in the code or SKILL.md content for this release. - Version number remains unchanged; functionality stays the same as the previous release.
v1.0.6
Version 1.0.6 - No file changes detected in this update. - No visible modifications to the SKILL.md or functionality. - Existing features and documentation remain unchanged.
v1.0.5
- Version bump to 1.0.5 with no code or documentation changes. - No file changes detected; functionality and instructions remain the same.
v1.0.4
No file changes detected in this version. - Version updated from 1.0.0 to 1.0.4 with no modifications to documentation or code files. - No new features, bug fixes, or other changes introduced in this release.
v1.0.3
Version 1.0.3 - No file changes detected in this release. - Functionality, interface, and documentation remain the same as the previous version.
v1.0.2
No changes detected in this version. - Version number updated to 1.0.2. - No files or documentation were changed.
v1.0.1
No user-visible changes detected in this version. - Version updated from 1.0.0 to 1.0.1. - No changes to functionality, features, or documentation.
v1.0.0
- 首个版本上线,基于 akshare-one 构建的 MCP 服务器,提供中国股票市场数据的综合接口。 - 支持获取历史行情、实时行情、相关新闻数据、财务报表数据、内部交易等多种金融信息。 - 严格要求 API 密钥,未配置密钥时需通过 AskUserQuestion 向用户询问后保存。 - 明确工具选择和参数提取流程,确保用户需求被准确路由到相应的数据接口。 - 工具所有返回结果以原始数据为主,进行适当整理后展示。
元数据
Slug akshare-one
版本 1.0.7
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 8
常见问题

股票数据接口服务 是什么?

基于akshare-one的MCP服务器,提供中国股票市场数据的全面接口,包括历史数据、实时数据、新闻数据和财务报表等金融信息。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 67 次。

如何安装 股票数据接口服务?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install akshare-one」即可一键安装,无需额外配置。

股票数据接口服务 是免费的吗?

是的,股票数据接口服务 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

股票数据接口服务 支持哪些平台?

股票数据接口服务 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 股票数据接口服务?

由 xiaobenyang-com(@xiaobenyang-com)开发并维护,当前版本 v1.0.7。

💬 留言讨论