fund-query
查询中国公募基金信息,支持收藏和分组管理。包括基金名称、单位净值、估算净值、涨跌幅等。使用天天基金 API 获取实时数据。当用户输入基金代码(6 位数字)、询问基金净值、或需要管理基金收藏/分组时使用此技能。
Best use case
fund-query is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
查询中国公募基金信息,支持收藏和分组管理。包括基金名称、单位净值、估算净值、涨跌幅等。使用天天基金 API 获取实时数据。当用户输入基金代码(6 位数字)、询问基金净值、或需要管理基金收藏/分组时使用此技能。
Teams using fund-query should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/fund-manage/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How fund-query Compares
| Feature / Agent | fund-query | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
查询中国公募基金信息,支持收藏和分组管理。包括基金名称、单位净值、估算净值、涨跌幅等。使用天天基金 API 获取实时数据。当用户输入基金代码(6 位数字)、询问基金净值、或需要管理基金收藏/分组时使用此技能。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
AI Agents for Startups
Explore AI agent skills for startup validation, product research, growth experiments, documentation, and fast execution with small teams.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
SKILL.md Source
# 基金查询技能
通过基金代码查询中国公募基金的名称、净值和涨跌幅信息,支持收藏和分组管理功能。
## 快速使用
### 查询单只基金
```
查询基金 161725
161725 净值
帮我看看 000001 基金
```
### 收藏管理
```
把 161725 加入收藏
收藏 000001 到白酒分组
显示我的基金收藏
刷新所有收藏的基金
从收藏移除 161725
```
### 分组管理
```
创建分组 白酒
创建分组 科技 重仓
显示所有分组
查看白酒分组的基金
刷新白酒分组
删除分组 重仓
```
## 命令行用法
### 查询
```bash
# 查询单只基金
python scripts/fund_query.py 161725
# 查询并添加到收藏(无分组)
python scripts/fund_query.py 161725 --add
```
### 收藏管理
```bash
# 添加基金到收藏(可指定多个分组)
python scripts/fund_query.py add 161725 白酒 重仓
# 添加基金到收藏(无分组)
python scripts/fund_query.py add 000001
# 从收藏移除
python scripts/fund_query.py remove 161725
# 显示收藏列表(全部)
python scripts/fund_query.py list
# 显示指定分组的基金(包括无分组的)
python scripts/fund_query.py list 白酒
# 刷新所有收藏
python scripts/fund_query.py refresh
# 刷新指定分组的基金
python scripts/fund_query.py refresh 白酒
# 更新基金的分组
python scripts/fund_query.py groups 161725 白酒 重仓
```
### 分组管理
```bash
# 创建分组
python scripts/fund_query.py group create 白酒
# 删除分组(不删除基金,仅移除分组关联)
python scripts/fund_query.py group delete 白酒
# 列出所有分组
python scripts/fund_query.py group list
```
## 数据源
- **API**: 天天基金网 (fund.eastmoney.com)
- **接口**: `https://fundgz.1234567.com.cn/js/{fund_code}.js`
- **数据格式**: JSONP
## 返回字段说明
| 字段 | 说明 |
|------|------|
| fund_code | 基金代码 (6 位数字) |
| fund_name | 基金名称 |
| estimated_net_value | 估算净值 (盘中实时) |
| unit_net_value | 单位净值 (最新确认) |
| growth_rate | 涨跌幅 (%) |
| trend | 趋势 (上涨/下跌/持平) |
| net_value_date | 净值日期 |
| valuation_time | 估值时间 |
| groups | 所属分组列表 |
| status | 状态 (success/error) |
## 分组功能
### 设计理念
- **一个基金可以属于多个分组**:如"白酒"和"重仓"
- **无分组的基金**:可以在任何分组查询中看到(作为全局基金)
- **删除分组**:只删除分组本身,不删除基金,基金变为无分组状态
### 数据存储
- **收藏数据**: `data/favorites.json`
- **分组数据**: `data/groups.json`
- **格式**: JSON
### 分组操作
**创建分组**:
```python
from scripts.fund_query import create_group
result = create_group("白酒")
# 返回:{"status": "success", "message": "已创建分组 '白酒'"}
```
**删除分组**:
```python
from scripts.fund_query import delete_group
result = delete_group("白酒")
# 删除分组,同时从所有基金中移除该分组关联
```
**列出分组**:
```python
from scripts.fund_query import list_groups
groups = list_groups()
# 返回:{"白酒": {"created_time": "...", "description": ""}, ...}
```
### 收藏操作
**添加收藏(指定分组)**:
```python
from scripts.fund_query import add_favorite
result = add_favorite("161725", ["白酒", "重仓"])
# 返回:{"status": "success", "message": "已添加..."}
```
**添加收藏(无分组)**:
```python
result = add_favorite("000001", [])
# 无分组的基金可以在任何分组查询中看到
```
**更新分组**:
```python
from scripts.fund_query import update_fund_groups
result = update_fund_groups("161725", ["白酒"])
```
**获取收藏列表**:
```python
from scripts.fund_query import list_favorites
# 获取全部(包括无分组的)
all_favorites = list_favorites()
# 获取指定分组的(包括无分组的)
baijiu_favorites = list_favorites("白酒")
# 获取无分组的
no_group_favorites = list_favorites("")
```
**刷新收藏**:
```python
from scripts.fund_query import refresh_favorites
# 刷新全部
all_results = refresh_favorites()
# 刷新指定分组
baijiu_results = refresh_favorites("白酒")
```
## 错误处理
脚本会处理以下错误情况:
- 基金代码格式错误 (非 6 位数字)
- 网络请求失败
- 数据解析错误
- 基金代码不存在
- 分组不存在
错误返回示例:
```json
{
"fund_code": "123",
"status": "error",
"message": "基金代码格式错误,应为 6 位数字"
}
```
## 使用模式
### 模式 1: 直接调用脚本
```python
import sys
sys.path.append('scripts')
from fund_query import get_fund_info, format_result, add_favorite, refresh_favorites
# 查询
result = get_fund_info("161725")
print(format_result(result))
# 收藏到多个分组
add_result = add_favorite("161725", ["白酒", "重仓"])
print(add_result["message"])
# 刷新指定分组
refresh_results = refresh_favorites("白酒")
for r in refresh_results:
if r["status"] == "success":
print(f"{r['fund_name']}: {r['growth_rate']:+.2f}%")
```
### 模式 2: 命令行调用
```bash
# 日常查询
python scripts/fund_query.py 161725
# 添加并分组
python scripts/fund_query.py add 161725 白酒 重仓
# 查看分组
python scripts/fund_query.py list 白酒
# 刷新分组
python scripts/fund_query.py refresh 白酒
```
## 注意事项
1. **请求频率**: 脚本内置随机延迟 (0.5-1.5 秒),避免请求过快
2. **交易时间**: 盘中数据为估算净值,收盘后为确认净值
3. **数据更新**: 净值通常在交易日 20:00 后更新
4. **网络依赖**: 需要访问天天基金网 API
5. **分组逻辑**: 无分组的基金可以在任何分组查询中看到
6. **数据文件**: 存储在 `data/` 目录,可手动编辑
## 示例基金代码
| 代码 | 名称 | 类型 |
|------|------|------|
| 161725 | 招商中证白酒指数 | 指数型 |
| 000001 | 华夏成长混合 | 混合型 |
| 110011 | 易方达中小盘 | 混合型 |
| 000566 | 华泰柏瑞创新升级 | 混合型 |
## 输出示例
### 查询结果
```
📊 基金查询结果
━━━━━━━━━━━━━━
基金代码:161725
基金名称:招商中证白酒指数 (LOF)A
单位净值:0.6667
估算净值:0.6596
涨跌幅度:-1.06% (下跌)
净值日期:2026-03-18
估值时间:2026-03-19 11:30
```
### 收藏列表(全部)
```
⭐ 我的基金收藏 (3 只)
━━━━━━━━━━━━━━
• 161725 - 招商中证白酒指数 (LOF)A [白酒] (收藏于:2026-03-19 04:49:59)
• 000001 - 华夏成长混合 [科技,重仓] (收藏于:2026-03-19 05:17:38)
• 110011 - 易方达优质精选混合 (QDII) [无分组] (收藏于:2026-03-19 05:18:00)
```
### 收藏列表(按分组)
```
⭐ 分组 '白酒' 的基金 (2 只)
━━━━━━━━━━━━━━
• 161725 - 招商中证白酒指数 (LOF)A [白酒] (收藏于:2026-03-19 04:49:59)
• 110011 - 易方达优质精选混合 (QDII) [无分组] (收藏于:2026-03-19 05:18:00)
```
### 分组列表
```
📁 我的分组 (3 个)
━━━━━━━━━━━━━━
• 白酒 (创建于:2026-03-19 05:17:21)
• 科技 (创建于:2026-03-19 05:17:24)
• 重仓 (创建于:2026-03-19 05:17:25)
```
### 刷新结果
```
🔄 收藏基金刷新结果 (3 只)
━━━━━━━━━━━━━━
📉 161725 招商中证白酒指数 (LOF)A [白酒]
净值:0.6667 | 涨跌:-1.06%
📉 000001 华夏成长混合 [科技,重仓]
净值:1.083 | 涨跌:-1.49%
📉 110011 易方达优质精选混合 (QDII) [无分组]
净值:5.1864 | 涨跌:-2.22%
━━━━━━━━━━━━━━
成功:3 | 失败:0
```Related Skills
fund
Complete fundraising and investment intelligence system for startups, nonprofits, and individuals raising capital. Trigger whenever someone needs to raise money: venture capital, angel investment, crowdfunding, nonprofit fundraising, or personal fundraising campaigns. Also triggers on phrases like "I need to raise money", "how do I pitch investors", "write my fundraising page", "what do VCs look for", "help me close this round", or any scenario involving convincing others to commit capital to a cause or venture.
gold-price-query
This skill retrieves real-time precious metal prices (gold, silver, platinum, palladium, etc.) from https://i.jzj9999.com/quoteh5. It provides bid/ask prices, daily high/low prices, and price trends for 20+ metal types.
stock-query
查询全球主要市场股票实时行情:A 股、港股、美股,以及场内 ETF、场外基金、主要指数。 需要:curl(HTTP 请求)、iconv(GBK→UTF-8 转码)。 Use when: 用户要求查询股价、基金净值、ETF 价格、大盘指数,或需要计算持仓市值时。 NOT for: 加密货币、期货、期权、外汇。
cn-stock-query
查询中国 A 股股票、场内 ETF 及场外基金的实时行情与最新净值。 Use when: 用户要求查询股价、基金净值、ETF 价格,或需要计算持仓市值时。 NOT for: 美股(含中概 ADR)、港股、加密货币、期货、期权。
gcp-bigquery-optimizer
Analyze BigQuery query patterns and storage to dramatically reduce the
refund-radar
Scan bank statements to detect recurring charges, flag suspicious transactions, and draft refund requests with interactive HTML reports.
deepseek-web-query
使用 DeepSeek 网页版进行互联网查询,分担大模型请求和搜索负担。当用户需要查询最新信息、一般性知识、代码问题、文本分析等,或明确说"用 DeepSeek 查一下"、"联网搜索"、"查下最新"等时触发此技能。特别地,如果提问以"ds:"或"ds:"开头,优先使用此技能。通过 Chrome DevTools MCP 控制浏览器与 DeepSeek 交互,自动检测登录状态并提示用户,保持浏览器会话复用,使用 evaluate_script 提取 Markdown 内容直接返回。
twitter-query
Query X/Twitter via twitterapi.io read-only APIs by account (user timeline) or by keyword (advanced search). Outputs structured JSON; no LLM, no trend scoring. Use when the user asks for tweets from a handle, user timeline, keyword/hashtag/cashtag search, or 推特/X 推文查询.
grant-funding-scout
NIH funding trend analysis to identify high-priority research areas
funding-trend-forecaster
Predict funding trend shifts using NLP analysis of grant abstracts from NIH, NSF, and Horizon Europe
fundraiseup
Interact with FundraiseUp REST API to manage donations, recurring plans, supporters, campaigns, and donor portal access. Process online and offline donations, retrieve fundraising analytics, and integrate with nonprofit CRM systems.
yahooquery
Access Yahoo Finance data including real-time pricing, fundamentals, analyst estimates, options, news, and historical data via the yahooquery Python library.