# 机构股本持股

- 接口：get_stock_institution_share_holdings
- 路径：/api/v2/market/data/institution/institution-share-holdings
- 方法：GET
- 描述：查询指定机构在指定报告期的持股汇总。按机构 ID + 年份 + 报告期 + 持仓类型查询，返回该机构在该报告期的持仓明细列表（持股数量、市值、净值/流通/总股本比例）、前 10 大持仓占比等。`institution_id`、`report_type`、`year`、`invest_type` 均必填。直接返回数组，命中时通常为 1 条。
- 数据范围：按报告期查询
- 单次限量：单个机构单个报告期通常返回 1 条聚合记录
- 提示：
  - `report_type` 取值：q1 / q2 / q3 / annual / announcement。
  - `invest_type` 取值：all / stock / fund / bond / other。
  - 缺少必填参数时返回错误。

## 输入参数

| 名称 | 类型 | 必选 | 描述 |
|------|------|------|------|
| institution_id | string | Y | 机构 ID |
| year | integer | Y | 年份 |
| report_type | string | Y | 报告类型：q1 / q2 / q3 / annual / announcement |
| invest_type | string | Y | 持仓类型：all / stock / fund / bond / other |


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

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


data 数组：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| year | integer | Y | 年份 |
| report_type | string | Y | 报告类型 |
| institution_type | string | Y | 机构类型（保留字段，暂为空） |
| invest_type | string | Y | 持仓类型 |
| institution_id | string | Y | 机构 ID |
| institution_code | string | Y | 机构代码 |
| institution_main_code | string | Y | 机构主编码 |
| institution_name | string | Y | 机构名称 |
| stock_holding_details | array | Y | 持仓明细列表 |
| top10_holding_ratio | string | Y | 前 10 大持仓占比 |

stock_holding_details 数组：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| stock_code | string | Y | 股票代码 |
| stock_name | string | Y | 股票名称 |
| holding_shares | number | Y | 持股数量（股） |
| market_value | number | Y | 市值（元） |
| net_value_ratio | number | N | 净值比例 |
| circulating_shares | number | Y | 流通股本（股） |
| total_shares | number | Y | 总股本（股） |

## 接口示例

```bash
curl -sS "https://market.ft.tech/gateway/api/v2/market/data/institution/institution-share-holdings?institution_id=XXX&year=2025&report_type=annual&invest_type=all"
```


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

```python
import ftshare as ft

market = ft.market_api()
df = market.stock_institution_share_holdings(
    institution_id="XXX",
    year=2025,
    report_type="annual",
    invest_type="all",
)
print(df)
```

## 数据样例

| year | report_type | institution_type | invest_type | institution_id | institution_code | institution_main_code | institution_name | stock_holding_details | top10_holding_ratio |
|------|------|------|------|------|------|------|------|------|------|
| 2025 | annual |  | all | XXX |  |  |  | [] | 0 |
