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

# Earnings Pack Search

> Search for earnings-related documents submitted to exchanges, including quarterly reports, semi-annual reports, and annual reports. Query is optional - if not provided, returns documents in reverse chronological order; if provided, sorts by relevance (note sort_by parameter).

## 财报包搜索

**URL**: `/v2/search/earnings-pack`\
**方法**: `POST`\
**描述**: Search for earnings-related documents submitted to exchanges, including quarterly reports, semi-annual reports, and annual reports. Query is optional - if not provided, returns documents in reverse chronological order; if provided, sorts by relevance (note sort\_by parameter).

### 请求参数

| 参数名             | 类型          | 必填 | 描述                                                                                                 |
| --------------- | ----------- | -- | -------------------------------------------------------------------------------------------------- |
| query           | str         | 否  | 搜索关键词（可选）。不提供时按时间倒序返回文档列表；提供时默认按相关性排序。                                                             |
| symbols         | array\[str] | 是  | 股票代码列表，格式为 market:ticker（如 `US:AAPL`、`HK:00700`、`SH:600519`、`SZ:000001`）。                          |
| num             | int         | 否  | 返回的结果数量，默认值为 `10`，最大值为 `100`。                                                                      |
| start\_datetime | str         | 否  | 开始时间，格式为 `YYYY-MM-DD` 或 `YYYY-MM-DD HH:MM:SS`。                                                     |
| end\_datetime   | str         | 否  | 结束时间，格式为 `YYYY-MM-DD` 或 `YYYY-MM-DD HH:MM:SS`。                                                     |
| fiscal\_year    | str         | 否  | 财年筛选，如 `2025`、`2026`。                                                                              |
| fiscal\_quarter | str         | 否  | 财季筛选，如 `Q1`、`Q2`、`Q3`、`Q4`。                                                                        |
| sort\_by        | str         | 否  | 排序方式：`date_desc`（时间倒序，无 query 时默认）、`relevance`（相关性排序，有 query 时推荐）、`date_asc`（时间正序）。默认 `date_desc`。 |

### 响应参数

| 参数名             | 类型     | 描述                   |
| --------------- | ------ | -------------------- |
| docs            | array  | 搜索结果文档数组，每个文档包含以下字段： |
|   doc\_id       | str    | 文档唯一 ID。             |
|   title         | str    | 文档标题。                |
|   summary       | str    | 文档摘要。                |
|   category      | str    | 文档类别。                |
|   published\_at | int    | 发布时间（毫秒级时间戳）。        |
|   companies     | array  | 相关公司列表。              |
|   metadata      | object | 文档元数据。               |
|   score         | number | 相关性评分。               |
|   url           | str    | 文档链接。                |
| total\_count    | int    | 匹配文档总数。              |
| took\_ms        | int    | 搜索执行时间（毫秒）。          |

### 请求示例

**cURL**

```bash theme={null}
curl -X POST https://api.reportify.cn/v2/search/earnings-pack \
-H "Authorization: Bearer 447460****09c9" \
-H "Content-Type: application/json" \
-d '{
    "query": "revenue growth",
    "symbols": ["US:AAPL", "US:TSLA"],
    "num": 10,
    "start_datetime": "2024-01-01",
    "end_datetime": "2024-12-31"
}'
```

**Python 示例**

```python theme={null}
import requests

url = "https://api.reportify.cn/v2/search/earnings-pack"
headers = {
    "Authorization": "Bearer 447460****09c9",
    "Content-Type": "application/json"
}
payload = {
    "query": "revenue growth",
    "symbols": ["US:AAPL", "US:TSLA"],
    "num": 10,
    "start_datetime": "2024-01-01",
    "end_datetime": "2024-12-31"
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
```

### 响应示例

```json theme={null}
{
  "docs": [
    {
      "doc_id": "947538495952523264",
      "title": "贵州茅台(600519) - 2022 Q4 - 年度财报",
      "summary": "### 财务数据\n- 公司2022年度营业收入为124,099,843,771.99元，同比增长16.87%\n- 公司2022年度归属于上市公司股东的净利润为62,791,872,697.72元，同比增长19.42%\n...",
      "category": "financials",
      "published_at": 1680192000000,
      "companies": [
        {
          "name": "贵州茅台",
          "stocks": [
            {
              "code": "600519",
              "market": "SH",
              "symbol": "SH:600519"
            }
          ]
        }
      ],
      "metadata": {
        "report_type": 1,
        "report_status": 2,
        "report_scope": 1,
        "report_language": "zh"
      },
      "score": 0.9948,
      "url": "https://reportify.cn/financials/947538495952523264"
    }
  ],
  "total_count": 1,
  "took_ms": 125
}
```

### 错误响应

| HTTP 状态码 | 描述       |
| -------- | -------- |
| 422      | 请求参数验证错误 |


## OpenAPI

````yaml POST /v2/search/earnings-pack
openapi: 3.1.0
info:
  title: Reportify API
  version: 1.0.0
  description: API documentation for Reportify's document management and search services.
servers:
  - url: https://api.reportify.cn
    description: Production server
security:
  - BearerAuth: []
paths:
  /v2/search/earnings-pack:
    post:
      tags:
        - openapi-v2-search
      summary: Earnings Pack Search
      description: >-
        Search for earnings-related documents submitted to exchanges, including
        quarterly reports, semi-annual reports, and annual reports. Query is
        optional - if not provided, returns documents in reverse chronological
        order; if provided, sorts by relevance (note sort_by parameter).
      operationId: earnings_pack_search_reportify_api_v2_search_earnings_pack_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchToolsEarningsPackRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchToolsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    SearchToolsEarningsPackRequest:
      properties:
        query:
          type: string
          title: Query
          description: >-
            Search query (optional). If not provided, returns documents sorted
            by date descending; if provided, results are sorted by relevance by
            default.
        num:
          type: integer
          maximum: 100
          minimum: 1
          title: Num
          description: Number of results to return
          default: 10
        symbols:
          items:
            type: string
          type: array
          title: Symbols
          description: >-
            Stock symbols in market:ticker format (e.g., US:AAPL, HK:00700,
            SH:600519, SZ:000001)
        start_datetime:
          type: string
          title: Start Datetime
          description: Start datetime in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format
        end_datetime:
          type: string
          title: End Datetime
          description: End datetime in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format
        fiscal_year:
          type: string
          title: Fiscal Year
          description: Fiscal year filter (e.g., '2025', '2026')
        fiscal_quarter:
          type: string
          title: Fiscal Quarter
          description: Fiscal quarter filter (e.g., 'Q1', 'Q2', 'Q3', 'Q4')
        sort_by:
          type: string
          title: Sort By
          description: >-
            Sort order: 'date_desc' (newest first, default when no query),
            'relevance' (by semantic relevance, recommended when query is
            provided), 'date_asc' (oldest first)
          default: date_desc
          enum:
            - relevance
            - date_desc
            - date_asc
      type: object
      required:
        - symbols
      title: SearchToolsEarningsPackRequest
      description: >-
        Request model for earnings-related documents search
        (quarterly/semi-annual/annual reports). Query is optional - if not
        provided, returns documents sorted by date desc.
    SearchToolsResponse:
      properties:
        docs:
          items:
            $ref: '#/components/schemas/SearchToolsDoc'
          type: array
          title: Docs
          description: Search result documents
        total_count:
          type: integer
          title: Total Count
          description: Total number of matching documents
          default: 0
        took_ms:
          type: integer
          title: Took Ms
          description: Search execution time in milliseconds
          default: 0
      type: object
      title: SearchToolsResponse
      description: Response model for all search tools
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SearchToolsDoc:
      properties:
        doc_id:
          type: string
          title: Doc Id
          description: Document ID
        title:
          type: string
          title: Title
          description: Document title
        summary:
          type: string
          title: Summary
          description: Document summary
        category:
          type: string
          title: Category
          description: Document category
        published_at:
          type: integer
          title: Published At
          description: Publication timestamp in milliseconds
        companies:
          items:
            $ref: '#/components/schemas/CompanyLabel'
          type: array
          title: Companies
          description: Related companies
        metadata:
          type: object
          title: Metadata
          description: Document metadata
        score:
          type: number
          title: Score
          description: Relevance score
        url:
          type: string
          title: Url
          description: Document URL
      type: object
      required:
        - doc_id
        - title
        - url
      title: SearchToolsDoc
      description: Individual search result document
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CompanyLabel:
      properties:
        name:
          type: string
          title: Name
        logo:
          type: string
          title: Logo
        stocks:
          items:
            $ref: '#/components/schemas/CompanyStock'
          type: array
          title: Stocks
      type: object
      required:
        - name
      title: CompanyLabel
    CompanyStock:
      properties:
        symbol:
          type: string
          title: Symbol
        market:
          type: string
          title: Market
        code:
          type: string
          title: Code
      type: object
      required:
        - symbol
        - market
        - code
      title: CompanyStock
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter your Bearer token

````