# 重大合同

- 接口：major_contract
- 路径：/api/v1/market/data/corporate/contract
- 方法：GET
- 描述：按披露日期区间查询 A 股上市公司披露的重大合同，返回合同双方、合同类型/名称、合同金额、占上年营收比例、签约日/披露日等。数据来源于东方财富（eastmoney）重大合同数据。`start_date` / `end_date` 必填且区间跨度不得超过 3 天。返回单对象信封，data 含 `total` 与 `items`。
- 数据范围：按披露日期区间查询
- 单次限量：查询区间最大跨度 3 天（超出返回 400）
- 提示：
  - `start_date` / `end_date` 必填，日期区间跨度不得超过 3 天。
  - `amounts` 为合同金额，`zsnd_yysr_bl` 为占上年营收比例（%）。
  - 多数文本字段（如 `signatory`、`counter_party`、`sign_date` 等）为可选，缺失返回 null。

## 输入参数

| 名称 | 类型 | 必选 | 描述 |
|------|------|------|------|
| start_date | string | Y | 起始日期（YYYYMMDD），区间跨度 ≤ 3 天 |
| end_date | string | Y | 结束日期（YYYYMMDD），区间跨度 ≤ 3 天 |

## 输出参数

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

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| code | integer | Y | 状态码 |
| message | string | Y | 状态信息 |
| data | object | Y | 数据对象（见下） |

data 对象：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| total | integer | Y | 合同总数 |
| items | array | Y | 重大合同列表 |

items 数组：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| seq | integer | Y | 序号 |
| security_code | string | Y | 证券代码 |
| security_short_name | string | Y | 证券简称 |
| signatory | string | Y | 签约方 |
| signatory_rel_name | string | Y | 签约方关系 |
| counter_party | string | Y | 合同对方 |
| counter_party_rel_name | string | Y | 合同对方关系 |
| contract_type_name | string | Y | 合同类型（如「销售合同」） |
| contract_name | string | Y | 合同名称 |
| amounts | string | Y | 合同金额 |
| snd_yysr | string | Y | 上年同期营收 |
| zsnd_yysr_bl | string | Y | 占上年同期营收比例（%） |
| operate_reve | string | Y | 营业收入 |
| sign_date | string | Y | 签约日期 |
| dim_rdate | string | Y | 披露日期 |

## 接口示例

```bash
curl -sS "https://market.ft.tech/gateway/api/v1/market/data/corporate/contract?start_date=20260614&end_date=20260617"
```

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

```python
import ftshare as ft

market = ft.market_api()

# 默认返回 DataFrame（start_date/end_date 跨度 ≤ 3 天）
df = market.major_contract(start_date="20260520", end_date="20260522")
print(df[["security_code", "security_short_name", "contract_name", "amounts", "dim_rdate"]].head(3))
#   security_code security_short_name                                     contract_name      amounts    dim_rdate
# 0        603887          城地香江  中国移动浙江公司2026年长三角(嘉善)数据中心...  440478645.99  2026-05-21

# 返回原始 JSON
payload = market.major_contract(start_date="20260520", end_date="20260522", raw=True)

```

## 数据样例

`start_date=20260818&end_date=20260820` 实测返回（节选）：

| security_code | security_short_name | contract_name | amounts | sign_date | dim_rdate |
|---------------|---------------------|---------------|---------|-----------|-----------|
| 601186 | 中国铁建 | 佛山经广州至东莞城际铁路鹭洲至新塘段广州段(除先期实施工程外)土建工程施工总承包项目(FSG-2标)中标合同 | 3014000000.0000 | null | 2026-08-20 |
| 601186 | 中国铁建 | 广州南沙2024NJY-5、2024NJY-6地块项目二期勘察设计施工总承包中标合同 | 2054000000.0000 | null | 2026-08-20 |
| 601186 | 中国铁建 | 泉州至厦门至漳州城际铁路R1线工程(漳州段)土建SG1标段中标合同 | 2177000000.0000 | null | 2026-08-20 |
