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

# 分紅記錄

> 查詢股票的分紅記錄，包括歷史及已知的未來分紅事件，支持日期、類型和分頁篩選。

## 套餐權限

| 套餐 | 可用 |
| - | :-: |
| 免費版 | ❌ |
| 基礎版 | ✅ |
| 專業版 | ✅ |
| 全量套餐（A 股、港股、美股） | ✅ |
| 企業版 | ✅ |

## 注意事項

* `amount` 是每股現金分紅金額的十進制字符串；非現金分派時可能為 `null`。分頁游標位于響應外層 `page`。

## 支持的市場

| 市場 | 示例 |
| - | - |
| 美股 | AAPL.US |
| 港股 | 700.HK |
| A股 | 600519.SH |

## 請求參數

| 參數 | 是否必須 | 說明 |
| - | :-: | - |
| `symbol` | 是 | 股票代碼 |
| `type` | 否 | 產品類型，當前支持 `stock` |
| `dividend_type` | 否 | `normal`、`special`、`non_cash`、`unknown` |
| `from` | 否 | 起始日期，格式 `YYYY-MM-DD` |
| `to` | 否 | 結束日期，格式 `YYYY-MM-DD` |
| `limit` | 否 | 單頁數量，默認 100，范圍 `1–500` |
| `cursor` | 否 | 下一頁游標 |

## 請求示例

```bash theme={null}
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.tickdb.ai/v1/fundamentals/dividends?symbol=AAPL&type=stock&limit=100"
```

## 返回字段說明

以下列出 `data` 及分頁字段；外層 `code=0` 表示成功。

| 字段 | 說明 |
| - | - |
| symbol | 股票代碼。 |
| events | 符合篩選條件的分紅記錄列表。 |
| └─ event\_id | 事件 ID。 |
| └─ type | 分紅類別。 |
| └─ distribution\_kind | 分派形式。 |
| └─ amount | 每股現金金額；非現金分派時可能為 null。 |
| └─ stock\_distribution\_ratio | 每股送股或轉增比例；例如 `0.7` 表示每 1 股送轉 0.7 股，即每 10 股送轉 7 股。 |
| └─ currency | 幣種。 |
| └─ declaration\_date | 公告日，格式 `YYYY-MM-DD`；可能為 `null`。 |
| └─ record\_date | 股權登記日，格式 `YYYY-MM-DD`；可能為 `null`。 |
| └─ ex\_date | 除權除息日，格式 `YYYY-MM-DD`；可能為 `null`。 |
| └─ payment\_date | 支付日，格式 `YYYY-MM-DD`；可能為 `null`。 |
| └─ description | 事件說明。 |
| └─ detail\_level | 詳情級別。 |
| page | 響應外層的分頁信息。 |
| └─ next\_cursor | 下一頁游標；末頁為空。 |
| └─ limit | 當前分頁上限。 |

每條記錄包含分紅類型、每股金額、幣種及相關日期；未來日期不代表分紅已經完成。


## OpenAPI

````yaml openapi.zh-Hant.yaml GET /v1/fundamentals/dividends
openapi: 3.1.0
info:
  title: TickDB API
  description: TickDB 統一即時行情數據 API，提供 REST 和 WebSocket 接入。
  version: 1.0.3
  contact:
    email: support@tickdb.ai
servers:
  - url: https://api.tickdb.ai
    description: 正式環境
security:
  - ApiKeyAuth: []
paths:
  /v1/fundamentals/dividends:
    get:
      tags:
        - fundamentals-capital-actions
      summary: 分紅記錄
      description: 查詢股票的分紅記錄，包括歷史及已知的未來分紅事件，支援日期、類型和分頁篩選。
      operationId: getFundamentalsDividends
      parameters:
        - $ref: '#/components/parameters/SymbolQuery'
        - $ref: '#/components/parameters/TypeQuery'
        - $ref: '#/components/parameters/DividendTypeQuery'
        - $ref: '#/components/parameters/FromQuery'
        - $ref: '#/components/parameters/ToQuery'
        - $ref: '#/components/parameters/DividendLimitQuery'
        - $ref: '#/components/parameters/CursorQuery'
      responses:
        '200':
          $ref: '#/components/responses/DividendsResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    SymbolQuery:
      name: symbol
      in: query
      required: true
      schema:
        type: string
        examples:
          - AAPL
          - '700'
          - '600519'
          - AAPL.US
          - 700.HK
          - 600519.SH
      description: 股票代碼
    TypeQuery:
      name: type
      in: query
      required: false
      schema:
        type: string
        enum:
          - stock
      description: 產品類型，當前支援 `stock`
    DividendTypeQuery:
      name: dividend_type
      in: query
      required: false
      schema:
        type: string
        enum:
          - normal
          - special
          - non_cash
          - unknown
      description: 分紅類型：`normal`、`special`、`non_cash`、`unknown`。
    FromQuery:
      name: from
      in: query
      required: false
      schema:
        type: string
        format: date
        examples:
          - '2024-01-01T00:00:00.000Z'
      description: 開始日期，格式 `YYYY-MM-DD`
    ToQuery:
      name: to
      in: query
      required: false
      schema:
        type: string
        format: date
        examples:
          - '2026-12-31T00:00:00.000Z'
      description: 結束日期，格式 `YYYY-MM-DD`
    DividendLimitQuery:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 500
        default: 100
      description: 單頁數量，默認 100，范圍 `1–500`
    CursorQuery:
      name: cursor
      in: query
      required: false
      schema:
        type: string
        minLength: 1
      description: 下一頁遊標；第一頁不傳
  responses:
    DividendsResponse:
      description: 分紅記錄回應。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DividendsEnvelope'
    ErrorResponse:
      description: >-
        錯誤回應。常見 HTTP 狀態包括
        400（參數錯誤）、401（驗證失敗）、403（權限或配額限制）、404（無符合條件的數據）、429（請求頻率限制）及 503（服務暫不可用）。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            missingAPIKey:
              summary: 缺少 API Key
              value:
                code: '1002'
                message: API key is required. Provide via X-API-Key header
                error: '1002'
            missingKind:
              summary: 缺少必填參數
              value:
                code: 40001
                message: kind is required
                data: null
            endpointForbidden:
              summary: API Key 無權存取此介面
              value:
                code: 3009
                message: This endpoint is not allowed for your API key
                data: null
            marketForbidden:
              summary: API Key 未開放該市場
              value:
                code: 3010
                message: Fundamentals market not allowed for your API key
                data:
                  market: US
            noAvailableSource:
              summary: 數據暫不可用
              value:
                code: 5003
                message: Data is temporarily unavailable
                data: null
            notFound:
              summary: 無符合條件的數據
              value:
                code: 40404
                message: shareholder detail not found
                data: null
            businessNoData:
              summary: 查詢條件沒有有效業務數據
              value:
                code: 40405
                message: valuation time series not found
                data: null
  schemas:
    DividendsEnvelope:
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          required:
            - page
          properties:
            data:
              $ref: '#/components/schemas/DividendData'
            page:
              $ref: '#/components/schemas/PageInfo'
    ErrorEnvelope:
      type: object
      required:
        - code
        - message
      properties:
        code:
          description: TickDB API 業務錯誤碼；可能是整數或字串，客戶端應先轉為字串再比較。
          oneOf:
            - type: integer
            - type: string
        message:
          type: string
          description: 錯誤說明。
        error:
          type: string
          description: 相容錯誤標識；僅部分錯誤回應返回。
        data:
          description: 可選的錯誤上下文；可能是 null、物件或陣列。
          oneOf:
            - type: 'null'
            - type: object
              additionalProperties: true
            - type: array
              items: {}
    SuccessEnvelope:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          const: 0
          description: 業務狀態碼，成功為 `0`。
    DividendData:
      type: object
      required:
        - symbol
        - events
      properties:
        symbol:
          type: string
          description: 股票代碼。
        events:
          type: array
          description: 符合篩選條件的分紅記錄列表。
          items:
            $ref: '#/components/schemas/DividendEvent'
      additionalProperties: true
    PageInfo:
      type: object
      required:
        - next_cursor
        - limit
      properties:
        next_cursor:
          type:
            - string
            - 'null'
          description: 下一頁游標；非空時原樣作為下一次請求的 cursor 參數，末頁為 null。
        limit:
          type: integer
          minimum: 1
          description: 當前分頁上限。
      additionalProperties: true
    DividendEvent:
      type: object
      required:
        - event_id
        - type
        - distribution_kind
        - description
        - amount
        - stock_distribution_ratio
        - currency
        - declaration_date
        - record_date
        - ex_date
        - payment_date
        - detail_level
      properties:
        event_id:
          type: string
          description: 事件 ID。
        type:
          type: string
          enum:
            - normal
            - special
            - non_cash
            - unknown
          description: 分紅類別。
        distribution_kind:
          type: string
          enum:
            - cash
            - stock
            - other_non_cash
            - unknown
          description: 分派形式。
        description:
          type:
            - string
            - 'null'
          description: 事件說明。
        amount:
          type:
            - string
            - 'null'
          description: 每股現金金額；非現金分派時可能為 null。
        stock_distribution_ratio:
          type:
            - string
            - 'null'
          description: 每股送股或轉增比例；例如 `0.7` 表示每 1 股送轉 0.7 股，即每 10 股送轉 7 股。
        currency:
          type:
            - string
            - 'null'
          description: 幣種。
        declaration_date:
          type:
            - string
            - 'null'
          format: date
          description: 公告日，格式 `YYYY-MM-DD`；可能為 `null`。
        record_date:
          type:
            - string
            - 'null'
          format: date
          description: 股權登記日，格式 `YYYY-MM-DD`；可能為 `null`。
        ex_date:
          type:
            - string
            - 'null'
          format: date
          description: 除權除息日，格式 `YYYY-MM-DD`；可能為 `null`。
        payment_date:
          type:
            - string
            - 'null'
          format: date
          description: 支付日，格式 `YYYY-MM-DD`；可能為 `null`。
        detail_level:
          type: string
          enum:
            - summary
            - detail
          description: 詳情級別。
      additionalProperties: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.