# A股现金流量表

- 接口：cashflow
- 路径：/api/v1/market/data/finance/cashflow
- 方法：GET
- 描述：查询 A 股上市公司现金流量表数据。按报告期逐行返回，每行包含一个报告期和多个财务科目列；缺失值为 `null`。报表类型字段反映返回数据的报表口径。同一路径支持两种模式：模式A 传 `stock_code` 查单票所有报告期；模式B 不传 `stock_code` 时必须同时提供 `year + report_type + page + page_size`，按单个报告期分页查所有票。报告类型 `report_type` 取值 `q1`、`q2`、`q3`、`annual`。
- 数据范围：按报告期查询
- 单次限量：模式B 接收 `page/page_size`；分页元数据随响应返回。
- 提示：
  - `stock_code` 格式为 6 位数字 + 交易所后缀，例如 `000001.SZ`；模式A 与模式B 二选一。
  - 模式A 单票查询不分页，返回该票全部报告期；模式B 才按 `page/page_size` 分页。
  - 每个科目字段都成对返回「本期值 + 同比值」：同比字段名 = 科目字段名 + `_ratio`（`cash_equ_inc` 例外，后缀为 `_yoy`）；同比无值时该字段为 null。

## 输入参数

| 名称 | 类型 | 必选 | 描述 |
|------|------|------|------|
| stock_code | string | N | A 股代码，6 位数字 + 后缀，例如 000001.SZ；存在则进入模式A 单票查询 |
| year | integer | N | 年份，模式B 必填，例如 2024 |
| report_type | string | N | 报告期类型，模式B 必填：q1 / q2 / q3 / annual |
| page | integer | N | 页码，模式B 必填，从 1 开始 |
| page_size | integer | N | 每页条数，模式B 必填，默认 50，最大 500 |


## 输出参数

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

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| code | integer | Y | HTTP 状态码；成功固定为 `200`。 |
| message | string | Y | 成功固定为 `success`；失败时为错误信息。 |
| data | object / null | Y | 成功时使用兼容分页结构；失败时为 `null`。模式 A 与模式 B 的字段见下文。 |

data 对象：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| items | array | Y | 当前页或单票查询的报告期记录 |
| total_items | integer | Y | 总记录数 |
| total_pages | integer | Y | 总页数；单票模式有记录时为 1，否则为 0 |

items 数组：

| 名称 | 类型 | 默认显示 | 描述 |
|------|------|---------|------|
| stock_code | string | Y | A 股代码 |
| stock_name | string | Y | 股票名称 |
| year | integer | Y | 年份 |
| report_type | string | Y | 报告期类型：q1 / q2 / q3 / annual |
| report_type_cn | string | Y | 报告期中文名 |
| publish_date | string | Y | 发布日期 YYYY-MM-DD |
| detail_report_type | string | Y | 报表明细类型，优先取「合并调整」 |
| cash_equ_inc | string | Y | 现金及现金等价物净增加额 |
| cash_equ_inc_yoy | string / null | Y | 现金及现金等价物净增加额同比 |
| net_oper_cash_flow | string | Y | 经营活动产生的现金流量净额 |
| net_oper_cash_flow_ratio | string / null | Y | 经营活动净额同比 |
| goods_sale_render_service_cash | string | Y | 销售商品、提供劳务收到的现金 |
| goods_sale_render_service_cash_ratio | string / null | Y | 销售商品提供劳务收到现金同比 |
| net_invest_cash_flow | string | Y | 投资活动产生的现金流量净额 |
| net_invest_cash_flow_ratio | string / null | Y | 投资活动净额同比 |
| invest_proceeds | string | Y | 取得投资收益收到的现金 |
| invest_proceeds_ratio | string / null | Y | 取得投资收益收到的现金同比 |
| fix_intan_long_pay_cash | string | Y | 购建固定无形长期资产支付的现金 |
| fix_intan_long_pay_cash_ratio | string / null | Y | 购建固定无形长期资产支付现金同比 |
| net_fin_cash_flow | string | Y | 筹资活动产生的现金流量净额 |
| net_fin_cash_flow_ratio | string / null | Y | 筹资活动净额同比 |

## 接口示例

```bash
curl -sS "https://market.ft.tech/gateway/api/v1/market/data/finance/cashflow?stock_code=000001.SZ"
```


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

```python
import ftshare as ft

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

## 数据样例

| stock_code | stock_name | year | report_type | report_type_cn | publish_date | detail_report_type | cash_equ_inc | cash_equ_inc_yoy | net_oper_cash_flow | net_oper_cash_flow_ratio | goods_sale_render_service_cash |
|------|------|------|------|------|------|------|------|------|------|------|------|
| 000001.SZ | 平安银行 | 2026 | q2 | 半年报 | 2026-08-15 | 合并未调整 | -53384000000.0000 | -209.9024 | 215012000000.0000 | 402.7649 | 0.0000 |
| 000001.SZ | 平安银行 | 2026 | q1 | 一季报 | 2026-04-25 | 合并未调整 | -52195000000.0000 | -277.7698 | 37802000000.0000 | 72.4246 | 0.0000 |
| 000001.SZ | 平安银行 | 2025 | annual | 年报 | 2026-03-21 | 合并未调整 | 85689000000.0000 | 307.6151 | 315858000000.0000 | 368.6097 | 0.0000 |
| 000001.SZ | 平安银行 | 2025 | q3 | 三季报 | 2025-10-25 | 合并未调整 | -22108000000.0000 | -13.3337 | 71783000000.0000 | 324.6924 | 0.0000 |
| 000001.SZ | 平安银行 | 2025 | q2 | 半年报 | 2026-08-15 | 合并调整 | 48574000000.0000 | 1304.1150 | 174682000000.0000 | 359.6204 | 0.0000 |
