# 期货主要品种交易周报

- 接口：fut_weekly_detail
- 路径：/api/v1/market/data/futures/fut-weekly-detail
- 方法：GET
- 描述：查询期货主要品种的周成交量、成交额、持仓量和周度变化。
- 数据范围：六家期货交易所的历史主要品种交易周报。
- 单次限量：分页；默认每页 50 条，最大 200 条。
- 提示：GET 参数放在 query；未定义参数会被拒绝。

## 输入参数

| 名称 | 类型 | 必选 | 描述 |
|------|------|------|------|
| week | string | N | 单个统计周期，格式 `YYYYWW`，例如 `202601`。 |
| prd | string | N | 期货品种代码；支持逗号分隔，例如 `CU,AL`。 |
| start_week | string | N | 开始统计周期，格式 `YYYYWW`。 |
| end_week | string | N | 结束统计周期，格式 `YYYYWW`。 |
| exchange | string | N | 交易所代码：`SHFE`、`INE`、`CZCE`、`CFFEX`、`DCE`、`GFEX`。 |
| page | integer | N | 页码，从 `1` 开始，默认 `1`。 |
| page_size | integer | N | 每页条数，默认 `50`，最大 `200`。 |

## 输出参数

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

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| code | integer | Y | 业务状态码；成功为 `200`。 |
| message | string | Y | 状态说明；成功为 `success`。 |
| data | object | Y | 分页数据对象。 |

data 对象：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| pageNum | integer | Y | 当前页码。 |
| pageSize | integer | Y | 当前每页条数。 |
| total | integer | Y | 满足条件的总记录数。 |
| pages | integer | Y | 总页数；无记录时为 `0`。 |
| records | array | Y | 当前页主要品种交易周报。 |

records 数组：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| exchange | string | Y | 交易所代码。 |
| prd | string | Y | 期货品种代码。 |
| name | string | Y | 品种名称。 |
| vol | integer | Y | 本周成交量。 |
| vol_yoy | string | Y | 成交量同比。 |
| amount | string | Y | 本周成交额。 |
| amout_yoy | string | Y | 成交额同比；字段拼写沿用接口返回。 |
| cumvol | integer | Y | 年内累计成交量。 |
| cumvol_yoy | string | Y | 累计成交量同比。 |
| cumamt | string | Y | 年内累计成交额。 |
| cumamt_yoy | string | Y | 累计成交额同比。 |
| open_interest | integer | Y | 持仓量。 |
| interest_wow | string | Y | 持仓量环比。 |
| mc_close | string | Y | 周末收盘价。 |
| close_wow | string | Y | 收盘价环比。 |
| week | string | Y | 统计周期，格式 `YYYYWW`。 |
| week_date | integer | Y | 周报统计截止日期，格式 `YYYYMMDD`。 |

## 接口示例

```bash
curl -sS "https://market.ft.tech/gateway/api/v1/market/data/futures/fut-weekly-detail?week=202628&prd=CU%2CAL&page=1&page_size=20"
```


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

```python
import ftshare as ft

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

## 数据样例

| exchange | prd | name | vol | vol_yoy | amount | amout_yoy | cumvol | cumvol_yoy | cumamt | cumamt_yoy | open_interest |
|------|------|------|------|------|------|------|------|------|------|------|------|
| SHFE | AL | 铝 | 1530392 | 4.1961217652 | 1773.9865465000 | 16.3024964196 | 78463973 | 106.6509013129 | 95331.5845602500 | 147.7042649582 | 578577 |
| SHFE | CU | 铜 | 967783 | 5.7158337311 | 5082.1900085000 | 39.6066097569 | 39758556 | 53.6402883581 | 203477.6355910000 | 102.4593814269 | 538091 |
