# 基金费率

- 接口：get_fund_fee
- 路径：/api/v1/market/data/fund/fund-fee
- 方法：GET
- 描述：查询基金费率（当前有效，分页；同类型多条扁平返回）。`fund_code` 必填，`charge_type` 费率类型过滤，`client_type` 客户类型过滤。返回分页结构（pageNum/pageSize/total/pages/records），含费率类型、收费模式、客户类型、适用市场、渠道、阶梯档位、区间、费率、描述、币种、单位、生效/废止日等 16 个字段。
- 数据范围：最新快照，无时间维度
- 单次限量：默认 `page=1`/`page_size=50`；上限 200
- 提示：
  - `fund_code` 必填（trade_code 形式，纯数字按 `.OF` 解析）。
  - `charge_type` 精确匹配：`日常申购费`/`日常赎回费`/`认购费`/`管理费`/`托管费`/`销售服务费`。
  - `client_type` 精确匹配：`一般`/`机构`/`养老金`/`REITs`。
  - 阶梯费率（如申购费）按 `tier_no` 分档，`tier_from`/`tier_to` 申购为万元、赎回为日。

## 输入参数

| 名称 | 类型 | 必选 | 描述 |
|------|------|------|------|
| fund_code | string | Y | 基金代码 |
| charge_type | string | N | 费率类型：日常申购费/日常赎回费/认购费/管理费/托管费/销售服务费 |
| client_type | string | N | 客户类型：一般/机构/养老金/REITs |
| page | integer | N | 页码，默认 1 |
| page_size | integer | N | 每页条数，默认 50，上限 200 |


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

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

data 对象：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| pageNum | integer | Y | 当前页码 |
| pageSize | integer | Y | 当前每页条数 |
| total | integer | Y | 总记录数 |
| pages | integer | Y | 总页数 |
| records | array | Y | 当前页基金费率列表 |

records 数组：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| fund_code | string | Y | 基金代码 |
| charge_type | string | Y | 费率类型 |
| charge_pattern | string | Y | 收费模式（前端/后端） |
| client_type | string | Y | 客户类型 |
| apply_market | string | Y | 适用市场 |
| channel | string | Y | 渠道 |
| tier_no | integer | N | 阶梯档序 |
| tier_desc | string | Y | 档位描述 |
| tier_from | string | N | 阶梯区间起（申购=万元/赎回=日） |
| tier_to | string | N | 阶梯区间止 |
| rate_min | string | N | 最小费率 |
| rate_max | string | N | 最大费率 |
| rate_desc | string | Y | 费率描述 |
| currency | string | Y | 币种 |
| unit | string | Y | 单位（% 费率 / 元 固定金额） |
| execute_date | string | Y | 生效日 |
| cancel_date | string | N | 废止日（当前有效为空） |

## 接口示例

```bash
curl -sS "https://market.ft.tech/gateway/api/v1/market/data/fund/fund-fee?fund_code=000001&page=1&page_size=5"
curl -sS "https://market.ft.tech/gateway/api/v1/market/data/fund/fund-fee?fund_code=000001&charge_type=管理费"
```

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

```python
import ftshare as ft

market = ft.market_api()

# 查询基金全部当前费率，限制返回条数
rows = market.fund_fee(fund_code="000001", limit=10)
print(rows)

# 按费率类型和客户类型查询
rows = market.fund_fee(
    fund_code="000001", charge_type="日常申购费", client_type="一般", limit=10
)

# 返回原始 JSON
payload = market.fund_fee(fund_code="000001", charge_type="管理费", raw=True)
```

## 数据样例

`fund_code=000001`（华夏成长混合A），节选核心列（fund_code/client_type/apply_market/channel/tier_from/tier_to/currency/cancel_date 列省略）：

| charge_type | charge_pattern | tier_no | tier_desc | rate_min | rate_max | rate_desc | unit | execute_date |
|-------------|----------------|---------|-----------|----------|----------|-----------|------|--------------|
| 日常申购费 | 后端收费模式 | 1 | 持有期限＜1年 | 1.8 | 1.8 | 1.8% | % | 20040117 |
| 日常申购费 | 前端收费模式 | 1 | 申购金额＜100万元 | 1.5 | 1.5 | 1.5% | % | 20100315 |
| 日常申购费 | 后端收费模式 | 2 | 1年≤持有期限＜2年 | 1.5 | 1.5 | 1.5% | % | 20040117 |
| 日常申购费 | 前端收费模式 | 2 | 100万元≤申购金额＜500万元 | 1.2 | 1.2 | 1.2% | % | 20100315 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... |
