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

# 获取市场深度



## OpenAPI

````yaml /cn/api-reference/openapi.json get /api/market-data/quote/depth
openapi: 3.1.0
info:
  title: Financial Context
  version: 1.0.0
  description: >-
    Financial Context 提供经过认证、按量计费的只读美股市场数据访问。可通过 `/api/market-data/*` 端点，针对
    `.US` 标的和 `US` 市场筛选条件访问行情、K 线、市场日历、基本面、新闻、选股器和相关分析。
servers:
  - url: https://openapi.fcontext.com
    description: 生产环境
security:
  - ApiKeyHeader: []
  - BearerAuth: []
tags:
  - name: 行情
    description: 行情、K 线、交易日、深度、经纪队列和其他市场数据端点。
  - name: 内容
    description: 证券内容：新闻和话题。
  - name: 市场
    description: 市场状态、交易日历、异常活动和排行。
  - name: 日历
    description: 财务事件日历。
  - name: 基本面
    description: 基本面、分析师评级、估值、股东和交易披露。
  - name: 选股器
    description: 选股策略、筛选条件和指标。
paths:
  /api/market-data/quote/depth:
    get:
      tags:
        - 行情
      summary: 获取市场深度
      parameters:
        - name: symbol
          in: query
          required: true
          description: 证券标的。
          schema:
            type: string
          example: AAPL.US
      responses:
        '200':
          description: 市场深度（买卖盘档位）
          content:
            application/json:
              schema:
                type: object
                properties:
                  depth:
                    $ref: '#/components/schemas/SecurityDepth'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: 需要付费的 Financial Context 方案或剩余数据请求额度。
        '403':
          description: 该凭证无权访问 Financial Context 市场数据。
components:
  schemas:
    SecurityDepth:
      type: object
      description: 市场深度（买卖盘档位）。
      additionalProperties: true
      properties:
        asks:
          type: array
          description: 卖盘深度档位。
          items:
            type: object
            additionalProperties: true
            properties:
              position:
                type: integer
                description: 深度档位。
              price:
                type: string
                description: 价格。
              volume:
                type: string
                description: 成交量。
              orderNum:
                type: integer
                description: 订单数量。
        bids:
          type: array
          description: 买盘深度档位。
          items:
            type: object
            additionalProperties: true
            properties:
              position:
                type: integer
                description: 深度档位。
              price:
                type: string
                description: 价格。
              volume:
                type: string
                description: 成交量。
              orderNum:
                type: integer
                description: 订单数量。
    Error:
      type: object
      description: 标准错误响应。
      additionalProperties: true
      properties:
        error:
          type: string
          description: 可读错误消息。
  responses:
    BadRequest:
      description: 请求参数无效。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: 缺少或使用了无效的 Financial Context 凭证。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'Unauthorized: missing API key'
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: '在账户设置中生成的 Financial Context key。请以 `x-api-key: <key>` 形式发送。'
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: OAuth access token
      description: >-
        面向具有 `market_data` scope 的 Financial Context CLI、MCP 或 agent 客户端的 OAuth
        bearer token。

````