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

# 获取实时行情

> 获取最新实时报价。支持按标的代码查询或按标的池查询。两种方式二选一。



## OpenAPI

````yaml /zh-Hans/api-reference/openapi.json get /v1/quotes
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/quotes:
    get:
      tags:
        - 实时行情
      summary: 获取实时行情
      description: 获取最新实时报价。支持按标的代码查询或按标的池查询。两种方式二选一。
      operationId: getQuotes
      parameters:
        - description: 标的代码，逗号分隔（如 `600000.SH,000001.SZ,AAPL.US`）
          example: 600000.SH,000001.SZ
          in: query
          name: symbols
          schema:
            type: string
        - description: >-
            标的池ID，逗号分隔。可选值：`CN_Stock`（A股）、`US_Stock`（美股）、`HK_Stock`（港股）、`CN_ETF`（ETF）
          in: query
          name: universes
          schema:
            enum:
              - CN_Stock
              - US_Stock
              - HK_Stock
              - CN_ETF
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuotesResponse'
          description: 行情数据
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    QuotesResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/Quote'
          type: array
      required:
        - data
      type: object
    Quote:
      description: 单个标的的实时行情快照
      properties:
        amount:
          description: 成交额
          type: number
        ext:
          $ref: '#/components/schemas/QuoteExt'
        high:
          description: 最高价
          type: number
        last_price:
          description: 最新价
          type: number
        low:
          description: 最低价
          type: number
        open:
          description: 开盘价
          type: number
        prev_close:
          description: 昨收价
          type: number
        region:
          description: 市场地区
          enum:
            - CN
            - US
            - HK
          type: string
        symbol:
          description: 标的代码
          example: 600519.SH
          type: string
        timestamp:
          description: 行情时间戳（毫秒）
          format: int64
          type: integer
        volume:
          description: 成交量
          format: int64
          type: integer
      required:
        - symbol
        - region
        - last_price
        - prev_close
        - open
        - high
        - low
        - volume
        - amount
        - timestamp
      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
    QuoteExt:
      description: 行情扩展字段（因市场而异）
      properties:
        amplitude:
          description: 振幅（小数）
          type: number
        change_amount:
          description: 涨跌额
          type: number
        change_pct:
          description: 涨跌幅（小数，如 0.01 表示 1%）
          type: number
        name:
          description: 标的名称
          type: string
        turnover_rate:
          description: 换手率（小数）
          type: number
        type:
          description: 标的具体类型（如 cn_equity）
          type: string
      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

````