> ## 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股**

示例：

* 美股：AAPL.US、TSLA.US、MSFT.US
* 港股：700.HK、9988.HK、3690.HK
* A股：000001.SH、000001.SZ

## 請求參數

| 參數名    | 是否必須 | 描述                                                                                             |
| ------ | ---- | ---------------------------------------------------------------------------------------------- |
| symbol | 是    | 股票代碼                                                                                           |
| type   | 否    | 產品類型，可選。代碼無歧義時無需傳遞；若返回 `AMBIGUOUS_SYMBOL` 錯誤，按提示傳入對應值即可。可選值：`stock`、`indices`、`crypto`、`forex` |


## OpenAPI

````yaml GET /v1/market/capital-flow
openapi: 3.0.0
info:
  title: TickDB API
  description: >-
    Unified real-time market data API — one connection for Forex, indices, US
    stocks, HK stocks, A-shares, and Crypto via REST and WebSocket.
  version: 1.0.1
  contact:
    email: support@tickdb.ai
servers:
  - url: https://api.tickdb.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v1/market/capital-flow:
    get:
      summary: Capital Flow
      description: Get capital flow data for a stock
      parameters:
        - name: symbol
          in: query
          required: true
          description: Stock symbol
          schema:
            type: string
            default: 700.HK
            example: 700.HK
        - name: type
          in: query
          required: false
          description: >-
            Symbol type, optional. Not required when the symbol is unambiguous;
            if the API returns an AMBIGUOUS_SYMBOL error, pass the value as
            indicated
          schema:
            type: string
            enum:
              - stock
              - indices
              - crypto
              - forex
            example: stock
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                  message:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      symbol:
                        type: string
                      timestamp:
                        type: integer
                      intraday_flow:
                        type: array
                        items:
                          type: object
                          properties:
                            timestamp:
                              type: integer
                            inflow:
                              type: string
                      distribution:
                        type: object
                        properties:
                          timestamp:
                            type: integer
                          capital_in:
                            type: object
                            properties:
                              large:
                                type: string
                              medium:
                                type: string
                              small:
                                type: string
                          capital_out:
                            type: object
                            properties:
                              large:
                                type: string
                              medium:
                                type: string
                              small:
                                type: string
                    example:
                      symbol: 700.HK
                      timestamp: 1773306211
                      intraday_flow:
                        - timestamp: 1773279000
                          inflow: '-12199.34'
                        - timestamp: 1773279060
                          inflow: '-15137.59'
                      distribution:
                        timestamp: 1773303000
                        capital_in:
                          large: '173056.31'
                          medium: '164958.55'
                          small: '83945.69'
                        capital_out:
                          large: '179434.39'
                          medium: '176045.91'
                          small: '92979.74'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````