> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alphafin.x-pai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Income statement

# 利润表

获取Ashare上市公司的利润表（损益表）数据，包括营业收入、营业成本、营业利润、净利润等财务指标。

## 接口说明

### HTTP请求

```
GET /v1/financials/income-statement
```

### 请求参数

| 参数名           | 类型  | 必选 | 描述                                                                       |
| ------------- | --- | -- | ------------------------------------------------------------------------ |
| `symbol`      | 字符串 | 是  | 股票代码，可以是单个代码或以逗号分隔的多个代码（最多10个）。支持多种格式，如`600519`、`sh.600519`或`600519.SH`。 |
| `period`      | 字符串 | 否  | 报告期类型，可选值：`annual`（年报）、`quarterly`（季报）、`ttm`（滚动12个月）。默认为`annual`。        |
| `begin_date`  | 字符串 | 否  | 起始日期，格式为`YYYY-MM-DD`。如果未指定，默认返回最近5个报告期的数据。                               |
| `end_date`    | 字符串 | 否  | 结束日期，格式为`YYYY-MM-DD`。如果未指定，默认为当前日期。                                      |
| `report_type` | 字符串 | 否  | 报表类型，可选值：`consolidated`（合并报表）、`parent`（母公司报表）。默认为`consolidated`。         |
| `fields`      | 字符串 | 否  | 指定返回字段，用逗号分隔。如果未指定，返回所有可用字段。                                             |
| `limit`       | 整数  | 否  | 返回的报告期数量限制，默认为5，最大为20。                                                   |

### 返回字段

| 字段名                 | 类型  | 描述               |
| ------------------- | --- | ---------------- |
| `symbol`            | 字符串 | 股票代码             |
| `name`              | 字符串 | 公司名称             |
| `income_statements` | 数组  | 利润表数据数组，按报告期降序排列 |

每个利润表数据项包含以下主要字段（根据会计准则可能有所差异）：

| 字段名                             | 类型  | 描述                                                   |
| ------------------------------- | --- | ---------------------------------------------------- |
| `report_date`                   | 字符串 | 报告期，格式为`YYYY-MM-DD`，如2022-12-31（年报）、2022-09-30（三季报）等 |
| `report_name`                   | 字符串 | 报告期名称，如"2022年年报"、"2022年第三季度报"                        |
| `revenue`                       | 数值  | 营业收入（元）                                              |
| `operating_cost`                | 数值  | 营业成本（元）                                              |
| `selling_expenses`              | 数值  | 销售费用（元）                                              |
| `admin_expenses`                | 数值  | 管理费用（元）                                              |
| `rd_expenses`                   | 数值  | 研发费用（元）                                              |
| `financial_expenses`            | 数值  | 财务费用（元）                                              |
| `interest_expenses`             | 数值  | 利息费用（元）                                              |
| `interest_income`               | 数值  | 利息收入（元）                                              |
| `investment_income`             | 数值  | 投资收益（元）                                              |
| `operating_profit`              | 数值  | 营业利润（元）                                              |
| `non_operating_income`          | 数值  | 营业外收入（元）                                             |
| `non_operating_expenses`        | 数值  | 营业外支出（元）                                             |
| `profit_before_tax`             | 数值  | 利润总额（元）                                              |
| `income_tax`                    | 数值  | 所得税费用（元）                                             |
| `net_profit`                    | 数值  | 净利润（元）                                               |
| `net_profit_parent`             | 数值  | 归属于母公司股东的净利润（元）                                      |
| `net_profit_minority`           | 数值  | 少数股东损益（元）                                            |
| `basic_eps`                     | 数值  | 基本每股收益（元/股）                                          |
| `diluted_eps`                   | 数值  | 稀释每股收益（元/股）                                          |
| `comprehensive_income`          | 数值  | 综合收益总额（元）                                            |
| `comprehensive_income_parent`   | 数值  | 归属于母公司股东的综合收益总额（元）                                   |
| `comprehensive_income_minority` | 数值  | 归属于少数股东的综合收益总额（元）                                    |
| `ebitda`                        | 数值  | 息税折旧摊销前利润（元）                                         |
| `gross_profit`                  | 数值  | 毛利润（元）                                               |
| `gross_margin`                  | 数值  | 毛利率（%）                                               |
| `operating_margin`              | 数值  | 营业利润率（%）                                             |
| `net_margin`                    | 数值  | 净利润率（%）                                              |
| `annual_growth_revenue`         | 数值  | 营业收入同比增长率（%），仅当period=annual或ttm时有效                  |
| `annual_growth_profit`          | 数值  | 净利润同比增长率（%），仅当period=annual或ttm时有效                   |

## 示例

### 请求示例

#### 获取单个公司的年度利润表

```bash theme={null}
curl -X GET "https://api.alphafin.x-pai.com/v1/financials/income-statement?symbol=600519&period=annual&limit=3" \
  -H "X-API-KEY: your_api_key_here"
```

#### 获取单个公司的季度利润表

```bash theme={null}
curl -X GET "https://api.alphafin.x-pai.com/v1/financials/income-statement?symbol=600519&period=quarterly&limit=4" \
  -H "X-API-KEY: your_api_key_here"
```

#### 获取多个公司的TTM利润表

```bash theme={null}
curl -X GET "https://api.alphafin.x-pai.com/v1/financials/income-statement?symbol=600519,000858&period=ttm&limit=1" \
  -H "X-API-KEY: your_api_key_here"
```

#### 获取指定字段

```bash theme={null}
curl -X GET "https://api.alphafin.x-pai.com/v1/financials/income-statement?symbol=600519&period=annual&fields=report_date,revenue,net_profit,basic_eps&limit=5" \
  -H "X-API-KEY: your_api_key_here"
```

### 响应示例

#### 单个公司年报响应

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "symbol": "600519",
    "name": "贵州茅台",
    "income_statements": [
      {
        "report_date": "2022-12-31",
        "report_name": "2022年年报",
        "revenue": 119937778604.24,
        "operating_cost": 16138284220.05,
        "selling_expenses": 5162392622.66,
        "admin_expenses": 5924657180.26,
        "rd_expenses": 601320452.67,
        "financial_expenses": -2729895923.10,
        "interest_expenses": 0.00,
        "interest_income": 2755974908.10,
        "investment_income": 350882136.86,
        "operating_profit": 95191902188.54,
        "non_operating_income": 134989064.48,
        "non_operating_expenses": 53478089.65,
        "profit_before_tax": 95273413163.37,
        "income_tax": 23806665723.61,
        "net_profit": 71466747439.76,
        "net_profit_parent": 71263121099.75,
        "net_profit_minority": 203626340.01,
        "basic_eps": 5.67,
        "diluted_eps": 5.67,
        "comprehensive_income": 71474201439.76,
        "comprehensive_income_parent": 71270575099.75,
        "comprehensive_income_minority": 203626340.01,
        "ebitda": 98329982188.54,
        "gross_profit": 103799494384.19,
        "gross_margin": 86.54,
        "operating_margin": 79.37,
        "net_margin": 59.59,
        "annual_growth_revenue": 16.18,
        "annual_growth_profit": 18.96
      },
      {
        "report_date": "2021-12-31",
        "report_name": "2021年年报",
        "revenue": 103203469169.81,
        "operating_cost": 14224681331.38,
        // 更多字段...
      },
      {
        "report_date": "2020-12-31",
        "report_name": "2020年年报",
        "revenue": 94915380916.90,
        "operating_cost": 16321622105.50,
        // 更多字段...
      }
    ]
  }
}
```

#### 多个公司TTM响应

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": [
    {
      "symbol": "600519",
      "name": "贵州茅台",
      "income_statements": [
        {
          "report_date": "2023-09-30",
          "report_name": "2023年TTM",
          "revenue": 127862735123.78,
          "operating_cost": 17220163352.33,
          "net_profit": 76120345692.38,
          "net_profit_parent": 75892467135.62,
          // 更多字段...
        }
      ]
    },
    {
      "symbol": "000858",
      "name": "五粮液",
      "income_statements": [
        {
          "report_date": "2023-09-30",
          "report_name": "2023年TTM",
          "revenue": 68295764320.91,
          "operating_cost": 24123867220.14,
          "net_profit": 23506789432.56,
          "net_profit_parent": 23126538911.33,
          // 更多字段...
        }
      ]
    }
  ]
}
```

#### 指定字段响应

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "symbol": "600519",
    "name": "贵州茅台",
    "income_statements": [
      {
        "report_date": "2022-12-31",
        "revenue": 119937778604.24,
        "net_profit": 71466747439.76,
        "basic_eps": 5.67
      },
      {
        "report_date": "2021-12-31",
        "revenue": 103203469169.81,
        "net_profit": 60037631911.96,
        "basic_eps": 4.78
      },
      {
        "report_date": "2020-12-31",
        "revenue": 94915380916.90,
        "net_profit": 46697285429.62,
        "basic_eps": 3.72
      },
      {
        "report_date": "2019-12-31",
        "revenue": 85429537827.66,
        "net_profit": 41206471014.43,
        "basic_eps": 3.28
      },
      {
        "report_date": "2018-12-31",
        "revenue": 73638186125.88,
        "net_profit": 35203625263.59,
        "basic_eps": 2.80
      }
    ]
  }
}
```

## 错误码

除了通用错误码外，此接口还可能返回以下错误码：

| 错误码                   | 描述                     |
| --------------------- | ---------------------- |
| `invalid_symbol`      | 无效的股票代码                |
| `invalid_period`      | 无效的报告期类型               |
| `invalid_report_type` | 无效的报表类型                |
| `no_data`             | 指定条件下无数据               |
| `too_many_symbols`    | 请求的股票代码数量超过上限（最多支持10个） |

## 注意事项

1. TTM（Trailing Twelve Months）数据是指最近12个月的滚动数据，适合消除季节性因素分析公司业绩。
2. 财务数据的更新频率与公司公告时间一致，通常年报在次年4月底前披露，季报在季度结束后一个月内披露。
3. 不同行业的公司财务科目可能有所不同，部分科目可能为null。
4. 所有金额数据的单位均为"元"。
5. 增长率字段在非年报或TTM模式下可能为null。
6. 历史数据可能因公司重述而与原始披露数据有所不同，我们提供的是最新重述后的数据。

## 报告期说明

Ashare上市公司需要披露的财报包括：

* **年报**：每年1月1日至12月31日的财务数据，通常在次年4月30日前披露。
* **半年报**：每年1月1日至6月30日的财务数据，通常在当年8月31日前披露。
* **一季报**：每年1月1日至3月31日的财务数据，通常在当年4月30日前披露。
* **三季报**：每年1月1日至9月30日的财务数据，通常在当年10月31日前披露。

使用`period=quarterly`可获取全部季度报告，包括一季报、半年报、三季报和年报。

## 相关接口

* [资产负债表](/api-reference/financials/balance-sheet)
* [现金流量表](/api-reference/financials/cash-flow)
* [财务指标](/api-reference/financials/financial-metrics)
* [财务报告披露日期](/api-reference/financials/report-dates)
