# 股票IPO

- 接口：stock_ipos
- 路径：/api/v1/market/data/stock-ipos
- 方法：GET
- 描述：获取 A 股 IPO（新股发行）信息。每项含发行价、发行数量、网上发行数量、发行市盈率、行业市盈率、申购上限、申购代码、申购日期、上市日期等，带标的代码。按分页参数返回 IPO 记录。
- 数据范围：全量 IPO 发行信息快照
- 单次限量：分页返回，默认 `page=1`、`page_size=50`
- 提示：
  - 仅支持分页，不支持业务字段筛选。
  - 响应列表位于 `data.records`，并返回 `total` 与 `pages`。

## 输入参数

| 名称 | 类型 | 必选 | 描述 |
|------|------|------|------|
| page | integer | N | 页码，从 1 开始，默认 1 |
| page_size | integer | N | 每页数量，默认 50 |

## 输出参数
成功响应外层固定为 `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 | IPO 记录 |

records 数组：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| symbol | string | Y | 标的代码 |
| symbol_name | string | N | 标的名称；无值时为 `null` |
| price | string | N | 发行价格；无值时为 `null` |
| shares | integer | Y | 发行数量 |
| online_shares | integer | N | 网上发行数量；无值时为 `null` |
| pe | string | N | 发行市盈率；无值时为 `null` |
| industry_pe | string | N | 行业市盈率；无值时为 `null` |
| max_subscription_shares | integer | N | 申购上限；无值时为 `null` |
| subscription_symbol_id | string | N | 申购代码；无值时为 `null` |
| subscription_date | string | N | 申购日期；无值时为 `null` |
| listing_date | string | N | 上市日期；无值时为 `null` |

## 接口示例

```bash
curl -sS "https://market.ft.tech/gateway/api/v1/market/data/stock-ipos?page=1&page_size=5"
```

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

```python
import ftshare as ft

market = ft.market_api()

# 默认返回 DataFrame（取第一页）
df = market.stock_ipos(page=1, page_size=5)
print(df[["symbol", "symbol_name", "price", "pe", "industry_pe", "listing_date"]])
#        symbol symbol_name price   pe  industry_pe listing_date
# 0  ...                ...   NaN  NaN          NaN         None
# ...

# limit 跨页取数（SDK 自动翻页拼成 20 行）
df = market.stock_ipos(limit=20)

# 返回原始 JSON（未经 DataFrame 抽取，分页结构）
payload = market.stock_ipos(raw=True)
```

## 数据样例

page=1&page_size=2 节选：

| symbol | symbol_name | subscription_date | price | pe | shares | online_shares |
|--------|-------------|-------------------|-------|-----|--------|---------------|
| 001248.SZ | 华润新能源 | 2026-06-22 | null | null | 2423343000 | 632176000 |
| 920193.BJ | ... | 2026-06-17 | 8.52 | 14.98 | 28000000 | 25200000 |
| ... | ... | ... | ... | ... | ... | ... |
