← 返回 Skills 市场
yannlong

iFind http API

作者 Yann Long · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
368
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install ifind
功能描述
Use a local Python wrapper around the official iFinD QuantAPI HTTP endpoints on quantapi.51ifind.com. Use when the user wants iFinD market, macro, fund, code...
使用说明 (SKILL.md)

iFinD

Use this skill to query iFinD via the local Python wrapper in scripts/ifind_api.py.

Environment preparation

Before first use, verify Python dependencies.

Required runtime dependency:

  • requests

A pinned dependency file is provided at scripts/requirements.txt.

Check quickly with:

python3 -c "import requests; print(requests.__version__)"

If missing, install it before running any API script:

python3 -m pip install -r scripts/requirements.txt

If the environment is externally managed, prefer a virtual environment, but installing requests is allowed for this skill when needed.

First rule: confirm refresh_token before querying

Before any data call:

  1. Check token status with: python3 scripts/ifind_token_store.py status
  2. If missing, prefer letting the agent obtain it directly from the official site:
    • open https://quantapi.51ifind.com
    • log in with the user's existing session, or ask the user to complete login if interactive approval is needed
    • go to the account information page
    • locate the refresh_token
  3. Store it only through: python3 scripts/ifind_token_store.py set --token '\x3CTOKEN>'
  4. Only fall back to asking the user to provide the token if the browser path is unavailable or login cannot be completed.

Never ask the user to paste shell commands that would echo the token back into chat. Never print the token after storing it.

Preferred token acquisition workflow

Prefer this order:

  1. Browser login to https://quantapi.51ifind.com and read the token from account information
  2. iFinD 超级命令客户端 → 工具 → refresh_token 查询
  3. Ask the user directly only as a fallback

If browser automation is used, keep the flow minimal and do not browse unrelated pages. Once the token is found, store it immediately and stop exposing it in further output.

Token storage policy

  • Storage path: ~/.openclaw/skills/ifind/credentials.json
  • File permission target: owner read/write only (600 on POSIX)
  • The store script writes the file and tightens permissions automatically.
  • The request script reads the refresh_token from that file unless IFIND_REFRESH_TOKEN is already present in the environment.
  • Prefer the stored token over hardcoding tokens into code or notes.

Quick workflow

1. Verify dependencies and token state

Run:

python3 -c "import requests; print(requests.__version__)"
python3 scripts/ifind_token_store.py status

If requests is missing, install it first:

python3 -m pip install -r scripts/requirements.txt

If the token is missing, obtain it through the preferred browser workflow and store it first.

2. Choose a calling path

  • For direct endpoint calls, use scripts/ifind_request.py endpoint
  • For common market-data work, use scripts/ifind_request.py preset
  • For Python integration or patching, read scripts/ifind_api.py
  • For endpoint details and payload shape, read references/iFind_API_Reference.md

3. Run the query

Examples:

python3 scripts/ifind_request.py preset realtime \
  --codes '300033.SZ,600000.SH' \
  --indicators 'open,high,low,latest,changeRatio,volume,amount'

python3 scripts/ifind_request.py preset ohlcv \
  --codes '000300.SH' \
  --startdate '2025-01-01' \
  --enddate '2025-03-01'

python3 scripts/ifind_request.py endpoint get_thscode \
  --payload '{"seccode":"300033","functionpara":{"mode":"seccode","sectype":"","market":"","tradestatus":"0","isexact":"0"}}'

Output discipline

When using returned data in analysis:

  • state the endpoint used
  • include the symbol universe / code list
  • include the requested date range or timestamp
  • include the returned perf, dataVol, or other useful metadata when relevant
  • if the API returns an error, surface the error code and message rather than guessing

References

  • references/iFind_API_Reference.md: local API wrapper reference and examples from the user
  • references/token-and-storage.md: refresh_token acquisition and storage procedure
  • scripts/ifind_api.py: local Python wrapper
  • scripts/ifind_request.py: CLI for endpoint/preset calls
  • scripts/ifind_token_store.py: token status/set/remove helper
安全使用建议
This skill appears to do what it says (local wrapper for iFinD). Before installing: (1) be aware you must provide a sensitive iFinD refresh_token — prefer setting IFIND_REFRESH_TOKEN in your environment for ephemeral use or allow the token-store script to write to ~/.openclaw/skills/ifind/credentials.json and verify its permissions (should be 600). (2) Only allow any browser automation or agent-driven browsing to read the account page with explicit consent — this flow can access your logged-in session and is sensitive. (3) Confirm the BASE_URL (quantapi.51ifind.com) is expected and that you trust the skill source (source is unknown). (4) If you have doubts, run the scripts locally yourself (inspect files) rather than granting the agent autonomous browser access, and consider running in an isolated environment.
功能分析
Type: OpenClaw Skill Name: ifind Version: 1.0.0 The skill bundle provides a legitimate Python wrapper and CLI for the iFinD QuantAPI (quantapi.51ifind.com). It includes well-structured scripts for managing API tokens and querying financial data, with clear documentation in SKILL.md and the references directory. Security practices are observed, such as restricting credential file permissions to the owner (600) in ifind_token_store.py and providing explicit instructions to the agent to avoid echoing sensitive tokens in chat or logs.
能力评估
Purpose & Capability
The name/description promise a local Python wrapper for iFinD/QuantAPI (quantapi.51ifind.com). The repository includes a clear wrapper (scripts/ifind_api.py), a CLI (ifind_request.py), token storage helper, and reference docs that all match that purpose. No unrelated cloud providers, unrelated binaries, or surprising capabilities are present.
Instruction Scope
SKILL.md restricts action to checking/setting a refresh_token, installing requests, and running the provided scripts; it documents preferred token-acquisition via the browser or iFinD client. This is within scope for accessing the API but does instruct using a browser/agent-driven flow to read the user's account page for a refresh_token — which is sensitive and should only be allowed with explicit user consent and minimal browsing. The instructions explicitly avoid printing the token or pasting it into chat, which is good.
Install Mechanism
No install spec or remote downloads; the skill is instruction-only and bundles Python source plus a pinned requirements.txt (requests). Risk is low: dependencies are standard (requests) and nothing is pulled from arbitrary URLs or executed automatically during install.
Credentials
The skill legitimately needs a sensitive refresh_token to call the iFinD API and both code and SKILL.md reference the IFIND_REFRESH_TOKEN environment variable and a local credential file. However, the registry metadata lists no required environment variables or primary credential — an omission that can mislead users about the need to supply/store a secret. The requested secret (refresh_token) is proportionate to the functionality, but it is sensitive and the metadata should declare it.
Persistence & Privilege
The skill writes only its own credential file under ~/.openclaw/skills/ifind/credentials.json and attempts to tighten file permissions to owner read/write (600). always:true is not set and the skill does not modify other skills or system-wide settings. That level of persistence is appropriate for storing an API refresh token.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ifind
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ifind 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of the iFinD skill for secure, local integration with iFinD QuantAPI endpoints. - Provides a wrapper around the official iFinD QuantAPI HTTP endpoints via a local Python script. - Enforces secure refresh_token acquisition and storage before any API call. - Outlines a clear, stepwise process for checking dependencies, obtaining tokens, and running sample queries. - Prefers browser-based token retrieval, with fallbacks for user-provided or command-line acquisition. - Ensures token storage with appropriate permissions and environment management. - Includes references to documentation and usage examples for market, macro, fund, code-conversion, calendar, report, and portfolio queries.
元数据
Slug ifind
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

iFind http API 是什么?

Use a local Python wrapper around the official iFinD QuantAPI HTTP endpoints on quantapi.51ifind.com. Use when the user wants iFinD market, macro, fund, code... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 368 次。

如何安装 iFind http API?

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

iFind http API 是免费的吗?

是的,iFind http API 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

iFind http API 支持哪些平台?

iFind http API 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 iFind http API?

由 Yann Long(@yannlong)开发并维护,当前版本 v1.0.0。

💬 留言讨论