> ## 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.

# 股東持倉詳情

> 根據股東對象 ID 查詢單個股東的持倉和交易明細。

## 套餐權限

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

## 注意事項

* `object_id` 應取自股東持倉接口中 `detail_available=true` 的記錄；否則可能返回 `404`。

## 支持的市場

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

## 請求參數

| 參數 | 是否必須 | 說明 |
| - | :-: | - |
| `symbol` | 是 | 股票代碼 |
| `type` | 否 | 產品類型，當前支持 `stock` |
| `object_id` | 是 | 來自股東持倉接口且 `detail_available=true` 的對象 ID |

## 請求示例

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

## 返回字段說明

以下列出 `data` 中的字段；外層 `code=0` 表示成功。

| 字段 | 說明 |
| - | - |
| symbol | 股票代碼。 |
| object\_id | 股東對象 ID。 |
| name | 股東名稱。 |
| title | 股東或機構標題。 |
| holding\_summary | 分報告期的持倉匯總。 |
| └─ accum\_buy | 該報告期累計買入數量。 |
| └─ accum\_sell | 該報告期累計賣出數量。 |
| └─ percent\_stock\_price\_changed | 該報告期股價變化比例，包含百分號。 |
| └─ period | 報告期。 |
| └─ stock\_price | 該報告期對應股價。 |
| holding\_periods | 可用持倉報告期列表。 |
| holding\_details | 逐報告期持倉明細。 |
| └─ filing\_date | 原始申報日期文本，例如 `2026/05/07`。 |
| └─ name | 股東名稱。 |
| └─ object\_id | 股東對象 ID。 |
| └─ percent\_shares\_changed | 持股比例變化，包含百分號。 |
| └─ percent\_shares\_held | 持股比例，包含百分號。 |
| └─ period | 報告期。 |
| └─ shares\_changed | 股份變動數量。 |
| └─ shares\_held | 持股數量。 |
| trading\_periods | 可用交易統計期間。 |
| tradings | 分期間交易匯總。 |
| └─ accum\_buy | 該期間累計買入數量。 |
| └─ accum\_sell | 該期間累計賣出數量。 |
| └─ net\_buy | 該期間凈買入數量。 |
| └─ period | 交易統計期間。 |
| └─ trading\_details | 該期間的交易明細列表。 |

返回股東持倉匯總、持倉期間、持倉明細、交易期間和交易匯總。沒有可用詳情時可能返回結構化 `404`。


## OpenAPI

````yaml openapi.zh-Hant.yaml GET /v1/fundamentals/shareholders/detail
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/shareholders/detail:
    get:
      tags:
        - fundamentals-holders
      summary: 股東持倉詳情
      description: 根據股東對象 ID 查詢單個股東的持倉和交易明細。
      operationId: getFundamentalsShareholderDetail
      parameters:
        - $ref: '#/components/parameters/SymbolQuery'
        - $ref: '#/components/parameters/TypeQuery'
        - $ref: '#/components/parameters/ObjectIDQuery'
      responses:
        '200':
          $ref: '#/components/responses/ShareholderDetailResponse'
        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`
    ObjectIDQuery:
      name: object_id
      in: query
      required: true
      schema:
        type: string
      description: 來自股東持倉介面且 `detail_available=true` 的對象 ID
  responses:
    ShareholderDetailResponse:
      description: 股東持倉詳情回應。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ShareholderDetailEnvelope'
    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:
    ShareholderDetailEnvelope:
      allOf:
        - $ref: '#/components/schemas/SuccessEnvelope'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/ShareholderDetailData'
    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`。
    ShareholderDetailData:
      type: object
      required:
        - symbol
        - object_id
        - name
        - holding_summary
        - holding_periods
        - holding_details
        - trading_periods
        - tradings
      properties:
        symbol:
          type: string
          description: 股票代碼。
        object_id:
          type: string
          description: 股東對象 ID。
        name:
          type: string
          description: 股東名稱。
        title:
          type:
            - string
            - 'null'
          description: 股東或機構標題。
        holding_summary:
          type: array
          description: 分報告期的持倉匯總。
          items:
            $ref: '#/components/schemas/ShareholderHoldingSummary'
        holding_periods:
          type: array
          description: 可用持倉報告期列表。
          items:
            type: string
        holding_details:
          type: array
          description: 逐報告期持倉明細。
          items:
            $ref: '#/components/schemas/ShareholderHoldingDetail'
        trading_periods:
          type: array
          description: 可用交易統計期間。
          items:
            type: string
        tradings:
          type: array
          description: 分期間交易匯總。
          items:
            $ref: '#/components/schemas/ShareholderTradingSummary'
      additionalProperties: false
    ShareholderHoldingSummary:
      type: object
      required:
        - accum_buy
        - accum_sell
        - percent_stock_price_changed
        - period
        - stock_price
      properties:
        accum_buy:
          type: string
          description: 該報告期累計買入數量。
        accum_sell:
          type: string
          description: 該報告期累計賣出數量。
        percent_stock_price_changed:
          type: string
          description: 該報告期股價變化比例，包含百分號。
        period:
          type: string
          description: 報告期。
        stock_price:
          type: string
          description: 該報告期對應股價。
      additionalProperties: false
    ShareholderHoldingDetail:
      type: object
      required:
        - filing_date
        - name
        - object_id
        - percent_shares_changed
        - percent_shares_held
        - period
        - shares_changed
        - shares_held
      properties:
        filing_date:
          type: string
          description: 原始申報日期文本，例如 `2026/05/07`。
        name:
          type: string
          description: 股東名稱。
        object_id:
          type: string
          description: 股東對象 ID。
        percent_shares_changed:
          type: string
          description: 持股比例變化，包含百分號。
        percent_shares_held:
          type: string
          description: 持股比例，包含百分號。
        period:
          type: string
          description: 報告期。
        shares_changed:
          type: string
          description: 股份變動數量。
        shares_held:
          type: string
          description: 持股數量。
      additionalProperties: false
    ShareholderTradingSummary:
      type: object
      required:
        - accum_buy
        - accum_sell
        - net_buy
        - period
        - trading_details
      properties:
        accum_buy:
          type: string
          description: 該報告期累計買入數量。
        accum_sell:
          type: string
          description: 該報告期累計賣出數量。
        net_buy:
          type: string
          description: 該期間凈買入數量。
        period:
          type: string
          description: 交易統計期間。
        trading_details:
          type: array
          description: 該期間的交易明細列表。
          items:
            type: object
            additionalProperties: true
      additionalProperties: false
  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.