# e互动

- 接口：ashare_interactions
- 路径：/api/v2/market/data/ashare-interactions
- 方法：GET
- 描述：按提问日期范围查询 A 股上市公司互动问答，返回公司、行业、问题、答复及其时间等业务信息。
- 数据范围：按提问时间 `time_q` 查询指定日期范围内的数据。
- 单次限量：分页返回，默认 `page=1`、`page_size=100`，`page_size` 最大 1000。调用方可根据返回的 `pages` 逐页获取查询范围内的全部记录。
- 提示：筛选参数均为精确匹配，可单独或组合使用；均不传时返回日期范围内全部互动问答。结果按提问时间降序、记录 ID 降序、股票代码升序排列。源数据缺项返回 `null`。

## 输入参数

| 名称 | 类型 | 必选 | 描述 |
|------|------|------|------|
| start_date | string | Y | 开始日期，格式 `YYYYMMDD` |
| end_date | string | Y | 结束日期，格式 `YYYYMMDD`，不能早于 `start_date` |
| trade_code | string | N | 股票代码，精确匹配，例如 `000001.SZ` |
| company_name | string | N | 公司名称，精确匹配 |
| industry_code | string | N | 行业代码，精确匹配 |
| industry_name | string | N | 行业名称，精确匹配 |
| data_source | string | N | 数据来源，精确匹配 |
| page | integer | N | 页码，从 1 开始，默认 1 |
| page_size | integer | N | 每页数量，默认 100，范围 1–1000 |

## 输出参数

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

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| code | integer | Y | 业务状态码；成功为 `200` |
| message | string | Y | 状态说明；成功为 `success` |
| data | object | Y | 成功时为业务数据对象；失败时为 `null`。其字段如下 |

data 对象：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| pageNum | integer | Y | 当前页码 |
| pageSize | integer | Y | 当前每页数量 |
| total | integer | Y | 满足条件的总记录数 |
| pages | integer | Y | 总页数；无记录时为 0 |
| records | array | Y | 当前页互动问答记录 |

records 数组：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| trade_code | string | Y | 股票代码 |
| company_name | string | Y | 公司名称 |
| industry_name | string | Y | 行业名称 |
| industry_code | string | Y | 行业代码 |
| id | integer | Y | 互动问答记录 ID |
| time_q | string | Y | 提问时间，格式 `YYYY-MM-DD HH:mm:ss`；源数据缺失时为 `null` |
| question | string | Y | 提问内容，可为 `null` |
| answer | string | Y | 答复内容，可为 `null` |
| time_a | string | Y | 答复时间，格式 `YYYY-MM-DD HH:mm:ss`；尚未答复或源数据缺失时为 `null` |
| data_source | string | Y | 数据来源，可为 `null` |

## 接口示例

```bash
curl -sS 'https://market.ft.tech/gateway/api/v2/market/data/ashare-interactions?start_date=20260801&end_date=20260811&page=1&page_size=100'
```

按股票代码查询：

```bash
curl -sS 'https://market.ft.tech/gateway/api/v2/market/data/ashare-interactions?start_date=20260801&end_date=20260811&trade_code=000001.SZ&page=1&page_size=100'
```

按行业名称查询：

```bash
curl -sS 'https://market.ft.tech/gateway/api/v2/market/data/ashare-interactions?start_date=20260801&end_date=20260811&industry_name=%E5%8D%B0%E5%88%B6%E7%94%B5%E8%B7%AF%E6%9D%BF&page=1&page_size=100'
```


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

```python
import ftshare as ft

market = ft.market_api()
df = market.ashare_interactions(
    start_date="20260801",
    end_date="20260811",
    page=1,
    page_size=100,
)
print(df)
```

## 数据样例

查询参数：`start_date=20260801`、`end_date=20260811`、`page=1`、`page_size=100`（`total=13846`），节选：

| trade_code | company_name | industry_name | industry_code | id | time_q | question | answer | time_a | data_source |
|------------|--------------|---------------|---------------|----|--------|----------|--------|--------|-------------|
| 002046.SZ | 国机精工集团股份有限公司 | 磨具磨料 | 104640103 | 7844096 | 2026-08-11 23:47:40 | 您好！请问截至8月10日公司股东人数是多少，谢谢！ | 您好，截止2026年8月10日，公司股东人数为44515。 | 2026-08-14 09:01:03 | 深交所互动易 |
| 301097.SZ | 宁波天益医疗器械股份有限公司 | 医疗耗材 | 104370503 | 7841565 | 2026-08-11 23:46:42 | 您好！请问截至8月10日公司股东人数是多少，谢谢！ | 尊敬的投资者，您好，截至2026年8月10日，公司共有股东数4,822户，感谢您的关注。 | 2026-08-12 15:00:04 | 深交所互动易 |
| 300907.SZ | 康平科技(苏州)股份有限公司 | 电机Ⅲ | 104630101 | 7844108 | 2026-08-11 23:45:30 | 您好！请问截至8月10日公司股东人数是多少，谢谢！ | 尊敬的投资者，您好！截至2026年8月10日，公司股东人数为9,262人。感谢您的关注！ | 2026-08-14 08:33:03 | 深交所互动易 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |

## 错误说明

| code | 场景 |
|------|------|
| 400 | 缺少日期、日期格式错误、开始日期晚于结束日期、分页参数越界或筛选值为空白 |
| 500 | 服务异常 |
