← Back to Skills Marketplace
yannlong

iFind http API

by Yann Long · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
368
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install ifind
Description
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...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install ifind
  3. After installation, invoke the skill by name or use /ifind
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug ifind
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 368 downloads so far.

How do I install iFind http API?

Run "/install ifind" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is iFind http API free?

Yes, iFind http API is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does iFind http API support?

iFind http API is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created iFind http API?

It is built and maintained by Yann Long (@yannlong); the current version is v1.0.0.

💬 Comments