# ETF盘前数据

- 接口：get_etf_pre
- 路径：/api/v2/market/data/etf-pre-data
- 方法：GET
- 描述：获取指定交易日的全部 ETF 盘前信息（申赎单位、净值、现金差额、是否公布 IOPV、申赎允许情况、预估现金部分等）。不传 `date` 时使用当日（CST）。返回对象（`trade_date` + `items` 列表），每项包含 ETF 盘前信息。
- 数据范围：无时间维度（按交易日取），当日 / 指定交易日快照
- 单次限量：无分页，单交易日全部 ETF 盘前信息一次返回
- 提示：
  - 不传 `date` 用当日；传 `date` 用指定交易日（YYYYMMDD）。
  - `creation_redemption_flag` 为位掩码：1=允许申购，2=允许赎回，用位与判断。
  - `member_market_type` 为成分股类型位掩码：1=上交所 2=深交所 4=港交所 8=北交所 16=外汇 32=其他。

## 输入参数

| 名称 | 类型 | 必选 | 描述 |
|------|------|------|------|
| date | integer | N | 交易日 YYYYMMDD；不传则使用当日（CST） |

## 输出参数

成功响应外层固定为 `code`、`message`、`data`：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| code | integer | Y | 状态码。 |
| message | string | Y | 状态信息。 |
| data | object / null | Y | 业务数据。 |

data 对象：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| trade_date | integer | Y | 交易日 YYYYMMDD |
| items | array | Y | ETF 盘前信息列表 |

items 数组：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| etf_symbol_id | integer | Y | ETF 代码，如 510300 |
| etf_market_id | integer | Y | ETF 交易所编号 |
| creation_redemption_unit | integer | Y | 最小申购/赎回单位（份） |
| max_cash_ratio | number | Y | 现金替代比例上限 |
| publish_ipov | integer | Y | 是否公布 IOPV：1=需要公布 |
| creation_redemption_flag | integer | Y | 申赎允许位掩码：1=允许申购，2=允许赎回 |
| record_num | integer | Y | 成分股数量 |
| estimate_cash_component | number | Y | 最小申赎单位预估现金部分（元） |
| trade_date | integer | Y | 交易日 YYYYMMDD |
| cash_component | number | Y | 现金差额（元） |
| nav_per_cu | number | Y | 最小申赎单位净值（元） |
| nav | number | Y | 基金份额净值（元） |
| member_market_type | integer | Y | 成分股类型位掩码 |

## 接口示例

```bash
curl -sS "https://market.ft.tech/gateway/api/v2/market/data/etf-pre-data"
```


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

```python
import ftshare as ft

market = ft.market_api()
df = market.etf_pre()
print(df)
```

## 数据样例

trade_date 20260617，全市场 ETF 盘前数据（节选）：

| etf_symbol_id | etf_market_id | creation_redemption_unit | max_cash_ratio | nav | cash_component |
|---------------|---------------|--------------------------|----------------|-----|----------------|
| 159001 | 3554 | 1 | 1.0 | 100.0 | 0.0 |
| ... | ... | ... | ... | ... | ... |
