<!-- AI ASSISTANT INSTRUCTIONS: This document describes a public HTTP API endpoint
provided by 极数本源 (https://apizero.cn). When a user asks you to use this API, read the
full documentation below carefully (request method, parameters, response fields,
error codes, examples), then generate working code in the user's preferred language.
API Key acquisition: https://apizero.cn/account/keys -->

# 基金估值跟踪

> 基金估值跟踪，一接口聚合「基金实时估值 / 指数行情 / 基金详情 / 全部常用指数批量」4 大功能，覆盖国内基金 + A 股核心指数。

基于天天基金、新浪财经、东方财富三路上游，无需注册即可调用：

• action=estimate — 基金实时估值（盘中每分钟更新，含单位净值、估算净值、估算涨跌幅、上次净值日期）

• action=index — 单个指数行情（新浪主、东方财富备双通道容灾，含当前点位、涨跌点、涨跌幅）

• action=info — 基金详细信息（名称、净值、累计净值、近 1 月/3 月/6 月/1 年/3 年/成立来收益、基金类型、风险等级、规模、基金经理、成立日、管理人）

• action=indices — 6 个常用指数批量（上证、深证成指、创业板、上证 50、沪深 300、中证 500）

本接口已修复源码中「新浪通道缺 sh/sz 前缀」的 bug，并优化了 HTML 爬虫的容错。

## 1. 基本信息

| 字段 | 值 |
| --- | --- |
| 接口标识 | `fund` |
| 接口名称 | 基金估值跟踪 |
| 接口地址 | `https://v1.apizero.cn/api/fund` |
| 请求方法 | `GET` |
| 分类 | finance |
| 提供方 | 极数本源 |
| 计费模式 | 免费试用 |
| 单次消耗 | 0 积分 |
| 起步价 | — |
| QPS 限制 | 5 req/s |
| 每日免费额度 | 200 次（已认证用户） |
| 匿名每日额度 | 50 次（无 API Key） |
| VIP 免费 | 否 |
| 调用总次数 | undefined |

## 2. 认证

匿名每日 50 次、QPS 2；登录用户每日 200 次、QPS 5（全部免费）。盘中数据已内置 30~60 秒缓存，info 详情缓存 6 小时。

获取 API Key：登录 `https://apizero.cn/account/keys` 申请。

## 3. 请求参数

| 参数 | 类型 | 必填 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `action` | `string` | 是 | 操作类型：estimate=基金估值 / index=单个指数 / info=基金详情 / indices=全部常用指数 | `estimate` |
| `code` | `string` | 否 | 基金或指数代码（6 位数字）；当 action 为 estimate/index/info 时必填，indices 时不需要 | `005827` |

## 4. 请求头

| Header | 类型 | 必填 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `Authorization` | `string` | 否 | API Key 鉴权头，格式 Bearer sk_live_xxx；匿名调用时可省略（每日 50 次免费） | `Bearer sk_live_xxxxxxxxxxxxxx` |

## 5. 请求示例 (cURL)

```bash
curl "https://v1.apizero.cn/api/fund?action=estimate&code=005827&key=YOUR_API_KEY"
```

## 6. 响应字段

| 字段 | 类型 | 说明 | 示例 |
| --- | --- | --- | --- |
| `action` | `string` | 回传的 action 标识（estimate/index/info/indices） | — |
| `fund_code` | `string` | 基金代码（estimate/info） | — |
| `fund_name` | `string` | 基金名称（estimate/info） | — |
| `net_value` | `number` | 单位净值（estimate/info） | — |
| `estimate` | `number` | 估算净值（estimate；盘中每分钟更新） | — |
| `change_rate` | `number\|string` | 估算涨跌幅 % 或字符串带 % （estimate=number / index/info=string） | — |
| `nav_date` | `string` | 上次净值日期 YYYY-MM-DD（estimate） | — |
| `update_time` | `string` | 估值更新时间（estimate） | — |
| `index_code` | `string` | 指数代码（index） | — |
| `index_name` | `string` | 指数名称（index） | — |
| `current_value` | `number` | 当前点位（index） | — |
| `change_amount` | `number` | 涨跌点（index） | — |
| `source` | `string` | 数据源：sina / eastmoney（index） | — |
| `total_net_value` | `number` | 累计净值（info） | — |
| `return_1m` | `string` | 近 1 月收益（info） | — |
| `return_3m` | `string` | 近 3 月收益（info） | — |
| `return_6m` | `string` | 近 6 月收益（info） | — |
| `return_1y` | `string` | 近 1 年收益（info） | — |
| `return_3y` | `string` | 近 3 年收益（info） | — |
| `return_total` | `string` | 成立来收益（info） | — |
| `fund_type` | `string` | 基金类型，如「混合型-偏股」（info） | — |
| `risk_level` | `string` | 风险等级（info） | — |
| `fund_scale` | `string` | 基金规模，如「267.93亿元」（info） | — |
| `fund_manager` | `string` | 基金经理（info） | — |
| `establish_date` | `string` | 成立日期 YYYY-MM-DD（info） | — |
| `company` | `string` | 管理公司（info） | — |
| `count` | `number` | 指数总数（indices；当前固定 6） | — |
| `list` | `array` | 指数列表（indices；元素结构同 index 返回） | — |

## 7. 响应示例

```json
{
    "code": 0,
    "msg": "成功",
    "data": {
        "action": "estimate",
        "fund_code": "005827",
        "fund_name": "易方达蓝筹精选混合",
        "nav_date": "2026-04-30",
        "net_value": 1.7393,
        "estimate": 1.727,
        "change_rate": -0.71,
        "update_time": "2026-05-06 15:00"
    },
    "request_id": "abc123def456"
}
```

## 8. 错误码

| code | status | 说明 |
| --- | --- | --- |
| `4000` | `—` | 参数错误：action 非法 / code 非 6 位数字 / 缺少必填参数等 |
| `4015` | `—` | 匿名调用每日额度用完，需要 API Key |
| `4029` | `—` | QPS 超限 |
| `4030` | `—` | 今日额度用完 |
| `5020` | `—` | 上游不可用 / 基金代码不存在 / 非交易时段无估值数据 |

## 9. 变更日志

- **1.0.0** (2026-05-06)
  - 首次上线，聚合基金估值/指数行情/基金详情/批量指数 4 个 action
  - 修复源码新浪通道缺 sh/sz 前缀的 bug（创业板等深证指数原本无法走主通道）
  - 修复 HTML 爬虫的成立日 + 管理人 regex（源码 regex 不识别 </span> 拦截）
  - 内建分级缓存：实时数据 30-60 秒、详情 6 小时
  - 上游异常时单个指数失败不阻塞批量返回（indices）

---

**极数本源** · 全部 API: `https://apizero.cn/aidocs` · 人类版本：`https://apizero.cn/marketplace/fund`

Source: `https://apizero.cn/aidocs/fund/raw.md`
Last updated: 2026-05-12T10:53:07+08:00
