# 基金持有人结构

- 接口：get_fund_holder_structure
- 路径：/api/v1/market/data/fund/fund-holder-structure
- 方法：GET
- 描述：查询基金持有人结构（按报告期）。`fund_code` 必填，`report_type` 精确匹配报告类型，`start_date`/`end_date` 报告期范围。直接返回数组（非分页），含持有人户数、户均持有份额、机构/个人/未分类/专业机构/ETF 联接/前十大持有人的份额与比例等 18 个字段。
- 数据范围：按报告期查询
- 单次限量：非分页，返回该基金全部报告期持有人结构
- 提示：
  - `fund_code` 必填（trade_code 形式，纯数字按 `.OF` 主体解析，如 `000001` 或 `000001.OF`）。
  - `report_type` 精确匹配：`年度报告`/`中期报告`/`上市公告书`/`基金合同生效公告`，缺省返回全部。
  - 非分页，直接返回数组。

## 输入参数

| 名称 | 类型 | 必选 | 描述 |
|------|------|------|------|
| fund_code | string | Y | 基金代码 |
| report_type | string | N | 报告类型：年度报告/中期报告/上市公告书/基金合同生效公告，缺省全部 |
| start_date | integer | N | 报告期起始日期 YYYYMMDD |
| end_date | integer | N | 报告期截止日期 YYYYMMDD |


## 输出参数
成功响应外层固定为 `code`、`message`、`data`：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| code | integer | Y | HTTP 状态码；成功固定为 200 |
| message | string | Y | 成功固定为 `success`；失败时为中文错误信息 |
| data | array / null | Y | 成功时为业务数据数组；失败时为 `null`。 |


data 数组：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| fund_code | string | Y | 基金代码 |
| report_type | string | Y | 报告类型 |
| publish_date | integer | Y | 公告日期 YYYYMMDD |
| report_date | integer | Y | 报告期 YYYYMMDD |
| holder_accounts | integer | N | 持有人户数 |
| avg_hold_shares | string | N | 户均持有份额（份） |
| insti_hold_shares | string | N | 机构持有份额（份） |
| insti_hold_rt | string | N | 机构持有比例（%） |
| indiv_hold_shares | string | N | 个人持有份额（份） |
| indiv_hold_rt | string | N | 个人持有比例（%） |
| undef_hold_shares | string | N | 未分类持有份额 |
| undef_hold_rt | string | N | 未分类持有比例（%） |
| prof_hold_shares | string | N | 专业机构持有份额 |
| prof_hold_rt | string | N | 专业机构持有比例（%） |
| etf_connect_shares | string | N | ETF 联接基金持有份额 |
| etf_connect_rt | string | N | ETF 联接基金持有比例（%） |
| top10_hold_shares | string | N | 前十大持有人持有份额 |
| top10_hold_rt | string | N | 前十大持有人持有比例（%） |

## 接口示例

```bash
curl -sS "https://market.ft.tech/gateway/api/v1/market/data/fund/fund-holder-structure?fund_code=000001"
curl -sS "https://market.ft.tech/gateway/api/v1/market/data/fund/fund-holder-structure?fund_code=000001&report_type=年度报告"
```

Python（[`ftshare`](https://github.com/FTShare-Lab/FTShare-python-sdk.git) SDK，方法 `market.fund_holder_structure`，默认返回 pandas `DataFrame`）：

```python
import ftshare as ft

market = ft.market_api()

# 查询全部报告期的持有人结构
rows = market.fund_holder_structure(fund_code="000001")
print(rows)

# 按报告类型查询
rows = market.fund_holder_structure(fund_code="000001", report_type="年度报告")

# 返回原始 JSON 数组
payload = market.fund_holder_structure(fund_code="000001", raw=True)
```

## 数据样例

`fund_code=000001`（华夏成长混合A，total=16），节选核心列（fund_code/insti_hold_shares/indiv_hold_shares/undef_*/etf_connect_*/top10_* 列省略）：

| report_type | publish_date | report_date | holder_accounts | avg_hold_shares | insti_hold_rt | indiv_hold_rt | prof_hold_rt |
|-------------|--------------|-------------|-----------------|-----------------|----------------|---------------|--------------|
| 年度报告 | 20260331 | 20251231 | 153718 | 17641.75 | 0.5 | 99.5 | 0 |
| 中期报告 | 20210830 | 20210630 | 180556 | 16923.07 | 0.59 | 99.41 | 0 |
| 年度报告 | 20210330 | 20201231 | 187692 | 18864.77 | 5.31 | 94.69 | 0 |
| ... | ... | ... | ... | ... | ... | ... | ... |
