openclaw-stock-skill
使用 data.diemeng.chat 提供的接口查询股票日线、分钟线、财务指标等数据,支持 A 股等市场。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
使用 data.diemeng.chat 提供的接口查询股票日线、分钟线、财务指标等数据,支持 A 股等市场。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Access the full suite of CarsXE vehicle data APIs — VIN decoding, license plate lookup, market value, vehicle history, safety recalls, lien/theft checks, OBD-II diagnostic code decoding, vehicle images, international VIN decoding, Year/Make/Model lookups, and plate/VIN OCR from images. Use this skill any time the user asks about a vehicle by VIN, plate, make/model, or OBD code. Also triggers for: "what's this car worth", "check for recalls", "vehicle history report", "decode this plate", "what does check engine code X mean", or any automotive data query. Always use this skill when working with CarsXE APIs — do not guess API behavior without it.
Generate images using Google Gemini models (Nano Banana 2 / gemini-3-pro-image-preview). Use when the user asks to create, generate, or make an image, picture, photo, or visual from a text description. Also supports image-to-image generation (modify/edit existing images). Supports multiple aspect ratios (1:1, 16:9, 9:16, 4:3, 3:4) and resolutions up to 4K. Triggers on phrases like "generate an image", "create a picture", "make me a photo", "draw", "visualize", "edit this image", "modify this picture", or any request to produce or transform visual content.
Convert SRT subtitle files into Remotion typing-animation videos with character-by-character text reveal and cinematic animated backgrounds. Use when the user wants a typewriter subtitle effect, SRT-to-video conversion, animated captions, or a Remotion project generated from subtitle files.
Connect an agent to TaskMaster — the coordination layer for the agentic economy. Use for: (1) Posting tasks and paying agents in USDC/ETH, (2) Accepting tasks as a worker and earning crypto, (3) Building portable on-chain reputation, (4) Dispute resolution, (5) Task decomposition and listing. Handles the full task lifecycle: authentication (wallet-based), on-chain escrow, task acceptance, completion, rating, and release. Includes best practices for 5-star completion, related skills, and quick start workflows. Requires a wallet with a small ETH balance on Base, Optimism, or Arbitrum.
Notion via notion-cli — a Rust CLI + MCP server for Notion API 2025-09-03+. Three-tier agent integration (read-only default, opt-in runtime writes, opt-in admin lifecycle) with rate limiting, response-size cap, untrusted-source output envelope, per-tier JSONL audit logs, and --check-request dry-runs. Supports the new data-source model, 22 property types, 12 block types, admin schema mutation, relation wiring, dedicated page-move endpoint, db update, and users me (v0.4).
| name | openclaw-stock-skill |
| description | 使用 data.diemeng.chat 提供的接口查询股票日线、分钟线、财务指标等数据,支持 A 股等市场。 |
| user-invocable | true |
| metadata | {"openclaw":{"emoji":"📈","skillKey":"openclaw-stock-skill","requires":{"env":["STOCK_API_KEY"]},"primaryEnv":"STOCK_API_KEY"}} |
本技能教会代理如何使用你自建的股票数据服务(线上域名 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 环境变量,并遵守上述限流与安全约定。