all in one skill for wencai 同花顺

v1.0.0

同花顺问财全功能合并技能。集成行情数据查询、指数数据查询、财务数据查询、基本资料查询、事件数据查询、公司经营数据查询、机构研究与评级查询、研报搜索、公告搜索、新闻搜索、问财选A股、问财选板块共12个子功能。只需配置 IWENCAI_BASE_URL 和 IWENCAI_API_KEY 两个环境变量,无需任何外部库...

0· 283·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for hhofchina/wen-cai.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "all in one skill for wencai 同花顺" (hhofchina/wen-cai) from ClawHub.
Skill page: https://clawhub.ai/hhofchina/wen-cai
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install wen-cai

ClawHub CLI

Package manager switcher

npx clawhub@latest install wen-cai
Security Scan
Capability signals
Requires sensitive credentials
These labels describe what authority the skill may exercise. They are separate from suspicious or malicious moderation verdicts.
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name/description state a consolidated iwencai (同花顺问财) client and the code implements POST calls to /v1/query2data and /v1/comprehensive/search on a configurable IWENCAI_BASE_URL using an IWENCAI_API_KEY. This is coherent. Note: the registry metadata lists no required env vars but the skill actually requires IWENCAI_API_KEY (and optionally IWENCAI_BASE_URL); this metadata mismatch should be corrected.
Instruction Scope
SKILL.md and scripts/cli.py limit behavior to transforming queries, calling the iwencai endpoints, parsing results, and formatting output. There are no instructions to read unrelated files, credentials, or system state. One caution: the skill honors an IWENCAI_BASE_URL override — if set to a non-official host it will send your API key and queries there.
Install Mechanism
No install spec or external downloads; the skill is instruction-only with a small Python CLI using only the standard library. No archive downloads or package installs are performed.
Credentials
The skill requires an IWENCAI_API_KEY (and optionally IWENCAI_BASE_URL) which is proportionate to its purpose. However the registry metadata failing to declare the required env var is an inconsistency. Also, because the base URL is configurable, setting IWENCAI_BASE_URL to an attacker-controlled host would expose the API key and query contents to that host.
Persistence & Privilege
The skill does not request persistent 'always' inclusion or modify other skills or system settings. It does not persist credentials beyond using the provided API key for outgoing requests.
Assessment
This skill appears to do what it says: it sends financial queries to the iwencai API and returns formatted results, requiring IWENCAI_API_KEY (and optionally IWENCAI_BASE_URL). Before installing: 1) provide a valid IWENCAI_API_KEY — don’t share other unrelated credentials; 2) keep IWENCAI_BASE_URL as the default (https://openapi.iwencai.com) unless you trust an alternative endpoint — changing it will cause the skill to send your API key and queries to that host; 3) be aware the package metadata omitted the required env var (IWENCAI_API_KEY) — confirm the registry entry is corrected if you rely on that metadata.

Like a lobster shell, security has layers — review code before you run it.

latestvk9795vvfp5wycm00fahs6rrteh84yy1s
283downloads
0stars
1versions
Updated 1w ago
v1.0.0
MIT-0

wen-cai — 同花顺问财全功能技能

将 12 个同花顺问财子技能合并为单一技能,仅依赖 Python 标准库,配置 IWENCAI_BASE_URLIWENCAI_API_KEY 即可使用。


环境变量

变量名说明示例
IWENCAI_API_KEY必填,问财 API Keysk-proj-xxx
IWENCAI_BASE_URL可选,默认 https://openapi.iwencai.comhttps://openapi.iwencai.com

功能路由表

根据用户意图自动选择接口和 channel:

用户意图接口channel / 说明
股票行情、涨跌幅、成交量、技术指标、资金流向/v1/query2data
指数行情、点位、涨跌幅/v1/query2data
财务数据、营收、净利润、ROE、负债率、现金流/v1/query2data
基本资料、公司简介、上市日期、行业归属/v1/query2data
事件数据、业绩预告、增发、解禁、质押、调研、监管函/v1/query2data
公司经营、主营业务、客户、供应商、重大合同/v1/query2data
机构评级、目标价、业绩预测、ESG、券商金股/v1/query2data
A股选股、股票筛选/v1/query2data
板块筛选、行业板块、概念板块/v1/query2data
研报搜索、研究报告/v1/comprehensive/searchchannels: ["report"]
公告搜索、年报、分红、回购公告/v1/comprehensive/searchchannels: ["announcement"]
财经新闻、行业动态、政策资讯/v1/comprehensive/searchchannels: ["news"]

核心处理流程

步骤 1:意图识别与接口路由

分析用户查询,按上面路由表选择接口和参数。

步骤 2:Query 改写

将口语化表达转为标准金融查询语句,保留核心意图。如需多维度查询(如同时要行情+财务),可拆分为多次调用。

步骤 3:API 调用

import urllib.request
import json
import os

BASE_URL = os.environ.get("IWENCAI_BASE_URL", "https://openapi.iwencai.com")
API_KEY  = os.environ["IWENCAI_API_KEY"]

HEADERS = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

def call_query2data(query, page="1", limit="10", is_cache="1", expand_index="true"):
    """适用于:行情、指数、财务、基本资料、事件、经营、机构评级、选股、选板块"""
    url = f"{BASE_URL}/v1/query2data"
    payload = {
        "query": query,
        "page": page,
        "limit": limit,
        "is_cache": is_cache,
        "expand_index": expand_index
    }
    data = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(url, data=data, headers=HEADERS, method="POST")
    with urllib.request.urlopen(req, timeout=30) as resp:
        result = json.loads(resp.read().decode("utf-8"))
    # status_code=0 为成功
    return result

def call_comprehensive_search(query, channel):
    """适用于:研报(report)、公告(announcement)、新闻(news)"""
    url = f"{BASE_URL}/v1/comprehensive/search"
    payload = {
        "channels": [channel],
        "app_id": "AIME_SKILL",
        "query": query
    }
    data = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(url, data=data, headers=HEADERS, method="POST")
    with urllib.request.urlopen(req, timeout=30) as resp:
        return json.loads(resp.read().decode("utf-8"))

步骤 4:数据解析

/v1/query2data 响应结构:

{
  "datas": [...],        // 数据列表
  "code_count": 150,     // 符合条件总数
  "chunks_info": {},     // 查询解析信息
  "status_code": 0,      // 0=成功
  "status_msg": ""
}

/v1/comprehensive/search 响应结构:

{
  "data": [
    {
      "title": "文章标题",
      "summary": "摘要",
      "url": "原文链接",
      "publish_date": "2026-04-15 10:00:00"
    }
  ]
}

步骤 5:空数据重试

datas 为空,适当放宽条件重试,最多2次

步骤 6:分页说明

  • 默认 limit=10page=1
  • code_count > len(datas),说明有更多数据,可通过 page 参数翻页
  • 选股/选板块场景下,code_count 可能很大,按需分页

步骤 7:回答用户


CLI 使用方式

# 行情查询
python3 scripts/cli.py --type market --query "比亚迪最新价格涨跌幅"

# 财务数据
python3 scripts/cli.py --type finance --query "比亚迪2025年净利润ROE"

# 事件数据
python3 scripts/cli.py --type event --query "比亚迪业绩预告机构调研"

# 机构评级
python3 scripts/cli.py --type rating --query "比亚迪券商评级目标价"

# 研报搜索
python3 scripts/cli.py --type report --query "比亚迪研报投资评级"

# 公告搜索
python3 scripts/cli.py --type announcement --query "比亚迪最新公告"

# 新闻搜索
python3 scripts/cli.py --type news --query "比亚迪最新动态"

# A股选股
python3 scripts/cli.py --type stock-select --query "今日涨幅超5%且成交量放大的A股"

# 板块筛选
python3 scripts/cli.py --type sector-select --query "今日资金净流入最多的板块"

# 翻页
python3 scripts/cli.py --type market --query "沪深300成分股行情" --page 2 --limit 20

子功能速查

子功能--type 参数接口
行情数据查询marketquery2data
指数数据查询indexquery2data
财务数据查询financequery2data
基本资料查询basicquery2data
事件数据查询eventquery2data
公司经营数据businessquery2data
机构研究与评级ratingquery2data
问财选A股stock-selectquery2data
问财选板块sector-selectquery2data
研报搜索reportcomprehensive/search
公告搜索announcementcomprehensive/search
新闻搜索newscomprehensive/search

错误处理


数据来源

所有数据均来源于 同花顺问财,回答时必须注明来源。

Comments

Loading comments...