# 基金日度估值

> 获取基金日度估值数据

## 接口基本信息

- **接口名称**: `get_fund_daily_valuation`
- **功能描述**: 获取基金日最终估值（日频）
- **数据更新频率**: 每日更新
- **请求方法**: `POST`
- **API 路径**: `https://api.wanxingai.com/openapi/get_fund_daily_valuation/`

---

## 输入参数说明

| 参数名 | 类型 | 必选 | 描述 | 示例 |
| --- | --- | --- | --- | --- |
| `fund_codes` | str | **是** | 基金代码，英文逗号分隔 | `000001.OF` |
| `begin_date` | str | **是** | 开始日期，格式 YYYY-MM-DD | `2024-01-01` |
| `end_date` | str | **是** | 结束日期，格式 YYYY-MM-DD | `2024-12-31` |
| `outputpara` | str | 否 | 输出字段控制，默认全部 | `finalValuation:Y` |

---

### 支持的指标列表

| 指标名 | 中文含义 |
| --- | --- |
| `finalValuation` | 日最终估值 |
| `netAssetValue` | 日实际净值 |
| `deviation` | 估值偏差率 |

---

## 使用示例

```python
import requests

url = "https://api.wanxingai.com/openapi/get_fund_daily_valuation/"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer sk-********"
}
payload = {
    "fund_codes": "000001.OF",
    "begin_date": "2026-01-01",
    "end_date": "2026-04-17"
}

resp = requests.post(url, json=payload, headers=headers)
print(resp.json())
```

```java
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
String json = "{
     "fund_codes": "000001.OF",
     "begin_date": "2026-01-01",
     "end_date": "2026-04-17"
}";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.wanxingai.com/openapi/get_fund_daily_valuation/"))
    .header("Content-Type", "application/json")
    .header("Authorization", "Bearer sk-********")
    .POST(HttpRequest.BodyPublishers.ofString(json))
    .build();

HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

```curl
curl -X POST https://api.wanxingai.com/openapi/get_fund_daily_valuation/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-********" \
  -d '{"fund_codes": "000001.OF", "begin_date": "2026-01-01", "end_date": "2026-04-17"}'
```

## 输入参数说明

| 参数名 | 类型 | 必选 | 默认值 | 描述 | 示例 |
| --- | --- | --- | --- | --- | --- |
| `marketcode` | str | **是** | — | 交易所代码：`212001`-上交所 / `212100`-深交所 / `212200`-港交所 | `212001` |
| `startdate` | str | **是** | — | 开始日期，格式 YYYY-MM-DD | `2026-04-01` |
| `enddate` | str | **是** | — | 结束日期，格式 YYYY-MM-DD | `2026-04-18` |
| `date_type` | str | 否 | `"0"` | 日期类型：`"0"`-交易日 / `"1"`-日历日 | `0` |
| `period` | str | 否 | `"D"` | 时间周期：`D`-日 / `W`-周 / `M`-月 / `Q`-季 / `S`-半年 / `Y`-年 | `D` |
| `date_format` | str | 否 | `"0"` | 返回日期格式：`"0"`-YYYY-MM-DD / `"1"`-YYYY/MM/DD / `"2"`-YYYYMMDD | `0` |
| `mode` | str | 否 | `"1"` | `"1"`-返回区间所有日期 / `"2"`-仅返回日期数量 | `1` |

---

### 常用 marketcode 列表

| 市场代码 | 市场名称 |
| --- | --- |
| `212001` | 上海证券交易所（上交所） |
| `212100` | 深圳证券交易所（深交所） |
| `212200` | 香港证券交易所（港交所） |

---

### 返回数据说明

| 字段名 | 类型 | 描述 |
| --- | --- | --- |
| `time` | array[str] | 交易日期列表（mode="1" 时） |
| `count` | int | 交易日数量（mode="2" 时） |

---
