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

# 获取市场深度（五档行情）

> 获取单个标的盘口数据（5档买卖价格和数量）。



## OpenAPI

````yaml /zh-Hans/api-reference/openapi.json get /v1/depth
openapi: 3.1.0
info:
  contact:
    email: support@tickflow.org
  description: 提供中国A股、美股、港股的实时和历史行情数据接口
  title: MarketData API
  version: 1.0.0
servers:
  - url: https://api.alphafeed.org
security:
  - ApiKeyHeader: []
  - ApiKeyQuery: []
tags:
  - description: 历史K线（OHLCV）数据
    name: K线数据
  - description: 实时报价和市场深度
    name: 实时行情
  - description: 日内分钟级别数据
    name: 日内分时
  - description: 标的元数据
    name: 基础信息
paths:
  /v1/depth:
    get:
      tags:
        - 实时行情
      summary: 获取市场深度（五档行情）
      description: 获取单个标的盘口数据（5档买卖价格和数量）。
      operationId: getDepth
      parameters:
        - description: 标的代码（如 `600000.SH`、`AAPL.US`、`00700.HK`）
          example: 600000.SH
          in: query
          name: symbol
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepthResponse'
          description: 市场深度数据
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    DepthResponse:
      properties:
        data:
          $ref: '#/components/schemas/MarketDepth'
      required:
        - data
      type: object
    MarketDepth:
      description: 五档盘口数据
      properties:
        ask_prices:
          description: 卖出价（卖1到卖5，升序）
          items:
            type: number
          type: array
        ask_volumes:
          description: 卖出量
          items:
            type: integer
          type: array
        bid_prices:
          description: 买入价（买1到买5，降序）
          items:
            type: number
          type: array
        bid_volumes:
          description: 买入量
          items:
            type: integer
          type: array
        region:
          description: 市场地区
          enum:
            - CN
            - US
            - HK
          type: string
        symbol:
          description: 标的代码
          type: string
        timestamp:
          description: 时间戳（毫秒）
          format: int64
          type: integer
      required:
        - symbol
        - region
        - timestamp
        - bid_prices
        - bid_volumes
        - ask_prices
        - ask_volumes
      type: object
    ErrorResponse:
      description: 错误响应
      properties:
        code:
          description: HTTP 状态码
          type: integer
        message:
          description: 错误描述
          type: string
      required:
        - code
        - message
      type: object
    RateLimitResponse:
      description: 限流响应
      properties:
        code:
          example: 429
          type: integer
        message:
          description: 限流说明
          type: string
        retry_after_ms:
          description: 建议等待时间（毫秒）
          type: integer
      required:
        - code
        - message
        - retry_after_ms
      type: object
  responses:
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: API Key 无效或缺失
    Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: 当前套餐无此功能/市场权限
    RateLimited:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitResponse'
      description: 请求频率超限
  securitySchemes:
    ApiKeyHeader:
      description: 在请求头 X-API-Key 中传递 API Key
      in: header
      name: X-API-Key
      type: apiKey
    ApiKeyQuery:
      description: 在 URL 查询参数 api_key 中传递 API Key
      in: query
      name: api_key
      type: apiKey

````