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

## 返回字段说明

| 字段名             | 描述      |
| --------------- | ------- |
| symbol          | 交易产品    |
| timestamp       | 数据更新时间戳 |
| intraday\_flow  | 资金流向数据  |
| └─ timestamp    | 分钟开始时间戳 |
| └─ inflow       | 净流入     |
| distribution    | 资金分布    |
| └─ timestamp    | 数据更新时间戳 |
| └─ capital\_in  | 流入资金    |
|     └─ large    | 大单      |
|     └─ medium   | 中单      |
|     └─ small    | 小单      |
| └─ capital\_out | 流出资金    |
|     └─ large    | 大单      |
|     └─ medium   | 中单      |
|     └─ small    | 小单      |


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

````