
Market Data
ifind-data
iFind Data, built on Tonghuashun's iFind API, provides a unified financial data query interface covering A-shares, Hong Kong and US stocks, funds, indices and financial statements.
Overview
iFind Data, built on Tonghuashun's iFind API, provides a unified financial data query interface covering A-shares, Hong Kong and US stocks, funds, indices and financial statements.
iFind Data, built on Tonghuashun's iFind API, provides a unified financial data query interface covering A-shares, Hong Kong and US stocks, funds, indices and financial statements. Features include historical series (get_date_serial), single-day indicators (get_basic_data), real-time quotes and Level2 (get_realtime_quotes), index constituents (get_data_pool) and WenCai natural-language stock selection (wencai_query). Supports HTTP API and local iFinDPy SDK calls, returning Pandas DataFrame for easy downstream analysis and processing. Suitable for real-time monitoring, quantitative backtesting, strategy stock selection, research reporting and portfolio analysis. Core advantages are flexible parameters, unified interfaces, easy integration and quick onboarding (.env configuration and example code).
Skill.md
How this skill works
iFind Data, built on Tonghuashun's iFind API, provides a unified financial data query interface covering A-shares, Hong Kong and US stocks, funds, indices and financial statements.
iFind Data
基于同花顺 iFind API 的金融数据查询技能,提供股票、基金、指数等金融数据的查询功能。
快速开始
环境配置
-
复制
assets/env.example为.env,填入认证信息:IFIND_USERNAME=your_username IFIND_PASSWORD=your_password -
安装依赖:
pip install requests pandas numpy python-dotenv loguru -
(可选)安装本地 SDK:从 https://quantapi.10jqka.com.cn 下载 iFinDPy
基本用法
from scripts.ifind_client import IFindClient
# 创建客户端并登录
client = IFindClient()
client.login()
# 获取股票收盘价
data = client.get_basic_data('000001.SZ', 'ths_close_price_stock', '2024-01-15,100')
# 获取实时行情
data = client.get_realtime_quotes(['000001.SZ', '600000.SH'])
# 问财自然语言查询
data = client.wencai_query('市值大于1000亿的股票', 'stock')
数据查询工作流
-
确定查询类型:
- 单日数据? → 使用
get_basic_data() - 历史序列? → 使用
get_date_serial() - 实时行情? → 使用
get_realtime_quotes() - 自然语言选股? → 使用
wencai_query()
- 单日数据? → 使用
-
构建查询参数:
- 证券代码格式:
000001.SZ(深交所)、600000.SH(上交所) - 日期格式:
YYYY-MM-DD或YYYYMMDD
- 证券代码格式:
-
执行查询并处理返回的 DataFrame
核心功能
股票数据查询
# 获取收盘价
client.get_basic_data('000001.SZ', 'ths_close_price_stock', '2024-01-15,100')
# 获取历史价格
client.get_date_serial('000001.SZ', 'ths_close_price_stock', 'Fill:Blank', '2024-01-01', '2024-01-15')
# 获取估值数据
client.get_basic_data('000001.SZ', 'ths_pe_stock,ths_pb_stock', '2024-01-15')
实时行情
# 获取最新价
client.get_realtime_quotes('000001.SZ', 'latest,changeRatio,volume')
# 获取 Level2 盘口
client.get_realtime_quotes('000001.SZ', 'latest,bid1,bid2,bid3,bid4,bid5,ask1,ask2,ask3,ask4,ask5')
问财查询
# 条件选股
client.wencai_query('市盈率小于20且ROE大于15%的股票', 'stock')
# 获取涨停股
client.wencai_query('今日涨停的股票', 'stock')
# 获取主力资金流向
client.wencai_query('主力资金流入的股票', 'stock')
指数和基金
# 获取指数成分股
client.get_data_pool('p03291', 'date=20240115;blockname=001005261', 'p03291_f001:Y,p03291_f002:Y')
# 获取基金净值
client.get_basic_data('000001.OF', 'ths_unit_nav_fund', '2024-01-15')
常用指标速查
| 简称 | 指标代码 | 说明 |
|---|---|---|
| 收盘价 | ths_close_price_stock | 日收盘价 |
| 市盈率 | ths_pe_stock | PE |
| 市净率 | ths_pb_stock | PB |
| 总市值 | ths_market_value_stock | 市值 |
| ROE | ths_roe_stock | 净资产收益率 |
更多指标参见 references/indicators.md
板块代码
| 简称 | 代码 |
|---|---|
| 全部A股 | 001005010 |
| 沪深300 | 001005261 |
| 中证500 | 001005262 |
| 上证50 | 001005260 |
更多板块代码参见 references/block_codes.md
资源
- scripts/ifind_client.py - iFind API 客户端,提供所有数据查询方法
- scripts/http_client.py - HTTP API 客户端,无需安装本地 SDK
- references/indicators.md - 完整指标代码参考
- references/block_codes.md - 板块代码参考
- references/api_examples.md - API 调用示例
- assets/env.example - 环境变量配置模板
Best used for
When to use it
iFind Data, built on Tonghuashun's iFind API, provides a unified financial data query interface covering A-shares, Hong Kong and US stocks, funds, indices and financial statements.

01 · PRE-MEETING
Prepare a decision brief
Turn scattered evidence into a structured case before an investment committee meeting.

02 · TEAM WORKFLOW
Standardize handoffs
Create consistent research outputs across analysts, portfolio managers, and agents.

03 · LIVE UPDATE
Refresh the thesis
Update scenarios after a new catalyst, KPI release, or earnings result.
Community notes
Built to improve with use.
随着 Skill 被使用与评审,反馈将展示在这里。
Discover more
Related skills
View allstrykr-prism
Strykr PRISM is a unified, real-time financial data API designed for AI agents, trading bots, and fintech applications. It provides canonical asset resolution (handles symbols, aliases, and…
gmgn-market
gmgn-market is a CLI-driven Skill for retrieving crypto and meme-token market data: K-line (candlestick/OHLCV) charts, trending token rankings by USD volume, Trenches token lists, and newly launched…
gmgn-portfolio
The gmgn-portfolio Skill uses the gmgn-cli to analyze crypto wallets on Solana, BSC, and Base, returning holdings, token balances, realized and unrealized P&L, portfolio statistics, trade history,…