> ## 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股 | 600519.SH, 000001.SZ |

## 请求参数

| 参数名 | 是否必须 | 描述 |
| - | - | - |
| symbol | 是 | 股票代码 |
| type | 否 | 产品类型，可选。代码无歧义时无需传递；若返回 `AMBIGUOUS_SYMBOL` 错误，按提示传入对应值即可。可选值：`stock`、`indices`、`crypto`、`forex` |

## 返回字段说明

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


## OpenAPI

````yaml openapi.yaml GET /v1/market/capital-flow
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/market/capital-flow:
    get:
      summary: 资金流向
      description: 获取股票的资金流向数据，包括主力资金、大单、中单、小单的流入流出情况。
      parameters:
        - name: symbol
          in: query
          required: true
          description: 股票代码
          schema:
            type: string
            default: 700.HK
            example: 700.HK
        - name: type
          in: query
          required: false
          description: >-
            产品类型，可选。代码无歧义时无需传递；若返回 `AMBIGUOUS_SYMBOL`
            错误，按提示传入对应值即可。可选值：`stock`、`indices`、`crypto`、`forex`
          schema:
            type: string
            enum:
              - stock
              - indices
              - crypto
              - forex
            example: stock
      responses:
        '200':
          description: 请求成功。
          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
                        format: int64
                        description: 数据更新时间，Unix 时间戳，单位为秒。
                      intraday_flow:
                        type: array
                        items:
                          type: object
                          properties:
                            timestamp:
                              type: integer
                              format: int64
                              description: 分钟开始时间，Unix 时间戳，单位为秒。
                            inflow:
                              type: string
                      distribution:
                        type: object
                        properties:
                          timestamp:
                            type: integer
                            format: int64
                            description: 数据更新时间，Unix 时间戳，单位为秒。
                          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

````

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