← 返回 Skills 市场
sinabs

China iFinD Skill(同花顺Skill)

作者 sinabs · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
609
总下载
0
收藏
2
当前安装
2
版本数
在 OpenClaw 中安装
/install ifind-api
功能描述
同花顺 iFinD (51ifind.com) 金融数据查询。支持 A 股/基金/债券/期货/指数的实时行情、历史行情、财务指标、宏观经济数据等 18 个 API 接口。 Chinese financial data query skill powered by THS iFinD (51ifind.com) A...
使用说明 (SKILL.md)

iFinD 金融数据查询

基于同花顺 iFinD (51ifind.com) 量化数据接口,覆盖 A 股、基金、债券、期货、指数等全品类金融数据。

运行机制

  1. Token 获取:使用用户提供的 IFIND_REFRESH_TOKEN 向 iFinD 官方 API 获取 access_token,缓存在本地 .data/access_token(24 小时 TTL)。
  2. API 调用:携带 access_token 调用 quantapi.51ifind.com 量化数据接口,返回 JSON 结果。
  3. 自动重试:当 token 过期(errorcode -1302)时自动刷新并重试一次。
  4. 日志:调用记录写入 .data/ifind.log(滚动日志,1MB 上限)。

本脚本仅与 iFinD 官方 API(quantapi.51ifind.com)通信,不连接任何第三方服务。

支持的 API

# API Endpoint 用途
1 基础数据 basic_data_service 财务指标、基本面数据
2 日期序列 date_sequence 按时间序列获取指标数据
3 历史行情 cmd_history_quotation 日K/周K等历史行情
4 高频序列 high_frequency 分钟级高频数据 + 技术指标
5 实时行情 real_time_quotation 最新价、涨跌幅、成交量
6 日内快照 snap_shot 逐笔/分钟级日内盘口快照
7 经济数据库 edb_service 宏观经济指标 (GDP、CPI 等)
8 专题报表 data_pool REITs、龙虎榜等专题数据
9 组合管理 portfolio_manage 组合新建/导入/交易/监控
10 智能选股 smart_stock_picking 按条件筛选股票
11 基金估值(分钟) fund_valuation 基金实时分钟级估值
12 基金估值(日) final_fund_valuation 基金日终估值
13 日期查询 get_trade_dates 查询交易日历
14 日期偏移 get_trade_dates 基于基准日前推/后推
15 数据量查询 get_data_volume 查询账号已用数据量
16 错误信息查询 get_error_message 查询错误码含义
17 代码转换 get_thscode 证券代码转同花顺代码
18 公告查询 report_query 上市公司公告检索下载

首次使用

每次调用 API 前,先按 API_REFERENCE.md 中「Token 配置」章节检查并配置 IFIND_REFRESH_TOKEN

如果未配置,停止执行,向用户提示:

使用 iFinD 金融数据查询需要你的 refresh_token。获取方式:

请把你的 refresh_token 发给我,我帮你配置好。

参考资料

  • API_REFERENCE.md - Token 配置、调用方式、18 个 API 完整参数和示例
安全使用建议
This skill is coherent for querying the iFinD API, but it requires your IFIND_REFRESH_TOKEN (a sensitive secret). Only provide that token if you trust the skill and the host. Prefer to set the token via a secure local mechanism (e.g., create ~/.openclaw/skills/ifind-api/.env yourself with restrictive permissions) rather than pasting it directly into a chat. After use, consider removing the token and cached access_token (.data/access_token) and inspect the local log (.data/ifind.log). Verify network calls go to quantapi.51ifind.com and review the script if you need higher assurance.
功能分析
Type: OpenClaw Skill Name: ifind-api Version: 1.0.1 The skill is a legitimate wrapper for the iFinD (51ifind.com) financial data API. The Python script `scripts/ifind-api.py` uses only standard libraries to handle API requests, token caching, and local logging without any suspicious external communication or obfuscation. The instructions in `SKILL.md` and `API_REFERENCE.md` guide the AI agent to assist the user in configuring the required `IFIND_REFRESH_TOKEN` using standard shell commands (grep/sed) targeting the skill's own configuration files, which is consistent with its stated purpose.
能力评估
Purpose & Capability
Name/description, SKILL.md, API reference and the Python script all consistently implement calls to iFinD (quantapi.51ifind.com). The single required env var (IFIND_REFRESH_TOKEN) is exactly what the API requires. No unrelated credentials, hosts, or binaries are requested.
Instruction Scope
Runtime instructions explicitly require the refresh token, fetch an access_token from the official API, call endpoints under quantapi.51ifind.com, and log calls to a local .data directory. The SKILL.md/REFERENCE instruct the agent to stop if no token is configured and to ask the user to provide it (including a sed example to write ~/.openclaw/skills/ifind-api/.env). Asking the user to paste a secret into chat is operationally necessary but should be surfaced to users as a privacy risk.
Install Mechanism
No install spec (instruction-only plus one Python script) — nothing is downloaded from external URLs or installed system-wide. The included Python script uses only the standard library.
Credentials
The skill requires a sensitive IFIND_REFRESH_TOKEN. The docs and code store tokens unencrypted on disk: refresh token may be written into the skill's .env (references show sed writing to ~/.openclaw/skills/ifind-api/.env) and access_token is cached in .data/access_token; logs are written to .data/ifind.log. These are reasonable for a client but are sensitive — users must trust the skill and secure the skill directory (file permissions, remove secrets when not needed). The SKILL.md explicitly asks users to paste the refresh_token into chat or write it into .env, which is a privacy concern if the user does not trust the skill or the agent.
Persistence & Privilege
always is false and the skill does not request system-wide changes or modify other skills. It persists local state within its own skill directory (.env, .data) which is normal for a client wrapper.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ifind-api
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ifind-api 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Updated API documentation in references/API_REFERENCE.md. - No changes to core features or code; only documentation improved.
v1.0.0
Initial release of china-ifind skill for Chinese financial data queries via THS iFinD API. - Supports real-time and historical data, financial indicators, macroeconomic data, fund valuation, and more across 18 API endpoints. - Requires user-provided IFIND_REFRESH_TOKEN to authenticate and manage API access. - Automatically manages token refresh and error handling, with logs stored locally. - All API calls communicate directly with iFinD official servers; no third-party connections. - Includes user prompts for token setup and reference documentation links.
元数据
Slug ifind-api
版本 1.0.1
许可证 MIT-0
累计安装 2
当前安装数 2
历史版本数 2
常见问题

China iFinD Skill(同花顺Skill) 是什么?

同花顺 iFinD (51ifind.com) 金融数据查询。支持 A 股/基金/债券/期货/指数的实时行情、历史行情、财务指标、宏观经济数据等 18 个 API 接口。 Chinese financial data query skill powered by THS iFinD (51ifind.com) A... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 609 次。

如何安装 China iFinD Skill(同花顺Skill)?

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

China iFinD Skill(同花顺Skill) 是免费的吗?

是的,China iFinD Skill(同花顺Skill) 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

China iFinD Skill(同花顺Skill) 支持哪些平台?

China iFinD Skill(同花顺Skill) 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 China iFinD Skill(同花顺Skill)?

由 sinabs(@sinabs)开发并维护,当前版本 v1.0.1。

💬 留言讨论