1018466411/openclaw-stock-data-skill/SKILL.md
使用 data.diemeng.chat 提供的接口查询股票日线、分钟线、财务指标等数据,支持 A 股等市场。
npx skillsauth add openclaw/skills openclaw-stock-skillInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
本技能教会代理如何使用你自建的股票数据服务(线上域名 https://data.diemeng.chat),通过 API Key 进行鉴权,查询股票的日线、分钟线、财务指标等数据。
⚙️ API Key 配置约定
- OpenClaw 会按照
skills.entries.<key>配置 把 API Key 和自定义配置注入到进程环境变量中。- 本技能约定使用环境变量
STOCK_API_KEY作为主密钥,并在metadata.openclaw.primaryEnv中声明,以便通过skills.entries.openclaw-stock-skill.apiKey统一配置。- 推荐的 OpenClaw 配置示例(
~/.openclaw/openclaw.json):{ skills: { entries: { "openclaw-stock-skill": { enabled: true, // 建议在 OpenClaw UI 的 Skill 参数面板里填写 apiKey, // Gateway 会自动将其写入 STOCK_API_KEY 环境变量 apiKey: { source: "env", provider: "default", id: "STOCK_API_KEY" }, env: { // 可在这里直接写死,或通过系统环境变量覆盖 STOCK_API_KEY: "YOUR_REAL_STOCK_API_KEY" }, config: { // 可选:覆盖默认域名 baseUrl: "https://data.diemeng.chat" } } } } }参考文档:Skills Config、Skills
https://data.diemeng.chat,如存在 skills.entries.openclaw-stock-skill.config.baseUrl 则优先使用配置中的 baseUrl。apiKey: <STOCK_API_KEY>(推荐)X-API-Key: <STOCK_API_KEY>apiKey 字段,但为了安全与规范,本技能统一通过 Header 传递。{ "code": 200, "msg": "成功", "data": { ... } }DataAccessVerifier 实现)。代理应将本技能视作一组 HTTP 能力,而不是单一接口:
代理在规划调用时,应根据用户自然语言意图,选择以上能力并组合使用。
POST /api/stock/daily{baseUrl}/api/stock/dailyPOSTContent-Type: application/jsonapiKey: <STOCK_API_KEY>DailyDataRequest):{
"stock_code": "000001.SZ",
"start_time": "2024-01-01",
"end_time": "2024-01-31",
"page": 0,
"page_size": 1000
}
stock_code 可以是单个字符串,也可以是字符串数组。start_time、end_time 格式为 YYYY-MM-DD。page 从 0 开始。data.total:总记录数data.list:每条记录包含 stock_code, trade_date, open, high, low, close, vol, amount 等字段,价格与成交量已在后端统一保留 2 位小数。代理在需要“某股某段时间的日 K 线”时,应优先选择该接口。
POST /api/stock/history{baseUrl}/api/stock/historyPOSTHistoryDataRequest):{
"stock_code": "000001.SZ",
"level": "5min",
"start_time": "2024-01-01 09:30:00",
"end_time": "2024-01-01 15:00:00",
"page": 0,
"page_size": 1000
}
level:"1min" | "5min" | "15min" | "30min" | "60min"start_time / end_time:
YYYY-MM-DD HH:MM:SSdata.list 中每条包含:stock_code, trade_time, open, high, low, close, vol, amount。用于用户询问“某天/某段时间内的分钟级行情、分时数据”等场景。
POST /api/stock/finance{baseUrl}/api/stock/financePOSTFinanceDataRequest):{
"stock_code": "000001.SZ",
"start_time": "2024-01-01",
"end_time": "2024-03-31",
"page": 0,
"page_size": 1000
}
trade_date, close, turnover_rate, turnover_rate_f, volume_ratio, pe, pe_ttm, pb, ps, ps_ttm, dv_ratio, dv_ttm, total_share, float_share, free_share, total_mv, circ_mv 等。适合估值分析、换手率、成交金额、市值等相关问题。
GET /api/stock/list{baseUrl}/api/stock/listGETstock_code(可选):精确股票代码筛选page:默认 0page_size:默认 20000success 结构中):
data.totaldata.list:包含 stock_code, name, area, industry, list_date, symbol, list_status, delist_date, is_hs 等。当用户只给出股票名称、地区、行业等描述时,可先通过该接口获取匹配列表,再提示用户选择具体代码。
GET /api/stock/valuation & GET /api/stock/valuation/listGET /api/stock/valuation{baseUrl}/api/stock/valuationGETstock_finance_daily, stock_industry, stock_ten_year_growth 等多张表,返回 StockValuationItem 列表。stock_code, stock_name, level1_name, level2_name, level3_namepe_ttm, pe_percentile, latest_price, dividend_yield_ttmindustry_avg_pe, industry_pe_rank, sector_pe_median, sector_pe_rankeps, roe, roa, eps_growth_10y, roe_growth_10y, avg_dividend_10y 等。当用户提问如“某只股票在行业内估值水平如何”“给我按市盈率从低到高列出某行业股票”时应优先考虑调用该接口。
GET /api/stock/valuation/list{baseUrl}/api/stock/valuation/listGETsort_by:pe_ttm | pe_percentile | dividend_yield_ttm | industry_pe_rank(默认 pe_ttm)sort_order:asc | desc(默认 asc)industry(可选)limit(默认 100)offset(默认 0)适合只需要“按某个指标排序的前 N 个股票”的场景。
GET /api/basic/calendar & GET /api/basic/snapshotGET /api/basic/calendar{baseUrl}/api/basic/calendarGETstart_time: YYYY-MM-DDend_time: YYYY-MM-DDdata 为数组,每条含 date, is_open(1 为交易日,0 为休市)。当用户问“某段时间哪些是交易日”“下一个交易日是什么时候”等,可使用此接口。
GET /api/basic/snapshot{baseUrl}/api/basic/snapshotGETstock_code(可选)page, page_size当用户需要“当前(最近一次)盘口快照”或大盘扫描时,可使用此接口。
API Key 获取与使用
STOCK_API_KEY 读取(由 OpenClaw 按 skills.entries.openclaw-stock-skill.apiKey 注入)。apiKey 或 api_key,后端会视为安全风险。错误处理
code = 401:API Key 无效或缺失,应提示用户检查在 OpenClaw Skill 配置中的 API Key。code = 403:权限不足或下载次数/访问次数限制,应向用户说明权限/限流约束。code = 429:请求过于频繁,需减少调用频率或提示用户稍后再试。分页与大数据量
data.total 很大,代理应分批分页请求,并在回答中做汇总,而不是一次性获取全部数据。单位与精度
当用户说:“帮我查一下 000001.SZ 在 2024 年 1 月份的日 K 线”
POST /api/stock/daily,stock_code = "000001.SZ",时间区间为 2024-01-01 至 2024-01-31。data.list 进行整理,总结涨跌幅、最大回撤、平均成交额等。当用户说:“按市盈率从低到高列出券商行业的前 20 只股票”
GET /api/stock/valuation/list,设置 industry = "证券"(或其它后端行业名称)、sort_by = "pe_ttm", sort_order = "asc", limit = 20。当用户说:“这周哪些天是交易日?”
GET /api/basic/calendar。is_open = 1 的日期列出,说明哪些是交易日。本技能不包含额外可执行脚本,完全通过指导代理调用现有 HTTP 接口工作。所有请求都应优先使用 STOCK_API_KEY 环境变量,并遵守上述限流与安全约定。
tools
Use when the user wants to connect to, test, or use the McDonalds service at mcp.mcd.cn, including checking authentication, probing MCP endpoints, listing tools, or calling McDonalds MCP tools through a reusable local CLI.
development
Web scraping platform — Twitter/X data, Vinted marketplace, and general web scraping API
development
SlowMist AI Agent Security Review — comprehensive security framework for skills, repositories, URLs, on-chain addresses, and products (Claude Code version)
data-ai
去除中文文本中的 AI 写作痕迹,使其读起来自然。基于维基百科 AI 写作特征指南,检测 24 种 AI 模式。触发词:humanizer-cn、去除 AI 痕迹、去除 AI 写作痕迹、中文文本人性化。