openapi: 3.1.0
info:
  title: Quote.Trade Public API for Agent Integrations
  version: 0.1.0
  description: >-
    Verified public Quote.Trade REST endpoints for agent integrations. The official
    Quote.Trade docs at https://doc.quote.trade are the canonical source of truth.
    This schema intentionally includes only public read-only endpoints. Authenticated
    trading documentation is maintained separately at https://quote.trade/trading-reference.
    Trading is high-risk and not financial advice.
servers:
  - url: https://app.quote.trade/api
security: []
tags:
  - name: Public Market Data
paths:
  /status:
    get:
      tags: [Public Market Data]
      operationId: getStatus
      summary: Get public Quote.Trade platform status
      security: []
      responses:
        '200':
          description: Platform status
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              examples:
                ok:
                  value:
                    system: operational
                    serverTime: 1765168545978
                    features:
                      leveraged_trading: true
                      dark_pool_mode: true
                      bridge_required: false
  /exchangeInfo:
    get:
      tags: [Public Market Data]
      operationId: getExchangeInfo
      summary: Get public exchange metadata and supported symbols when available
      security: []
      responses:
        '200':
          description: Exchange metadata
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                properties:
                  exchangeFilters:
                    type: array
                    items: {type: object, additionalProperties: true}
                  rateLimits:
                    type: array
                    items: {type: object, additionalProperties: true}
                  serverTime: {type: integer}
                  symbols:
                    type: array
                    items: {$ref: '#/components/schemas/Symbol'}
  /getInstrumentPairs:
    get:
      tags: [Public Market Data]
      operationId: getInstrumentPairs
      summary: Get public instrument pair metadata when available
      security: []
      parameters:
        - name: limit
          in: query
          required: false
          schema: {type: integer, minimum: 1, maximum: 5000, default: 100}
      responses:
        '200':
          description: Instrument pair list
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                properties:
                  instrumentPairs:
                    type: array
                    items: {$ref: '#/components/schemas/Symbol'}
  /ticker:
    get:
      tags: [Public Market Data]
      operationId: getTicker
      summary: Get public ticker for a symbol
      security: []
      parameters:
        - name: symbol
          in: query
          required: true
          schema: {type: string, examples: [BTC]}
      responses:
        '200':
          description: Ticker
          content:
            application/json:
              schema: {$ref: '#/components/schemas/Ticker'}
              examples:
                btc:
                  value:
                    symbol: BTC
                    lastUpdateId: '1765169207049'
                    price: '91201.73'
                    bid: '90928.07'
                    ask: '91475.39'
        '400': {$ref: '#/components/responses/APIError'}
        '429': {$ref: '#/components/responses/RateLimitError'}
  /depth:
    get:
      tags: [Public Market Data]
      operationId: getOrderBook
      summary: Get public order book depth for a symbol
      security: []
      parameters:
        - name: symbol
          in: query
          required: true
          schema: {type: string, examples: [BTC]}
        - name: limit
          in: query
          required: false
          schema: {type: integer, minimum: 1, default: 100}
      responses:
        '200':
          description: Order book
          content:
            application/json:
              schema: {$ref: '#/components/schemas/OrderBook'}
        '400': {$ref: '#/components/responses/APIError'}
        '429': {$ref: '#/components/responses/RateLimitError'}
components:
  responses:
    APIError:
      description: API error
      content:
        application/json:
          schema: {$ref: '#/components/schemas/APIError'}
    RateLimitError:
      description: Rate limit or temporary ban; honor Retry-After
      headers:
        Retry-After:
          schema: {type: string}
      content:
        application/json:
          schema: {$ref: '#/components/schemas/RateLimitError'}
  schemas:
    Symbol:
      type: object
      additionalProperties: true
      properties:
        id: {type: integer}
        symbol: {type: string, examples: [BTC]}
        status: {type: string, examples: [TRADING]}
        baseAsset: {type: string, examples: [BTC]}
        quoteAsset: {type: string, examples: [USD]}
        name: {type: string, examples: [Bitcoin]}
        quantityScale: {type: integer}
        address: {type: string}
        url: {type: string, format: uri}
      required: [symbol]
    Ticker:
      type: object
      additionalProperties: true
      properties:
        symbol: {type: string, examples: [BTC]}
        lastUpdateId: {type: string}
        price: {type: string, examples: ['91201.73']}
        bid: {type: string, examples: ['90928.07']}
        ask: {type: string, examples: ['91475.39']}
      required: [symbol, price]
    OrderBook:
      type: object
      additionalProperties: true
      properties:
        symbol: {type: string, examples: [BTC]}
        lastUpdateId: {type: string}
        bids:
          type: array
          items:
            type: array
            prefixItems: [{type: string}, {type: string}]
            minItems: 2
            maxItems: 2
        asks:
          type: array
          items:
            type: array
            prefixItems: [{type: string}, {type: string}]
            minItems: 2
            maxItems: 2
      required: [symbol, bids, asks]
    APIError:
      type: object
      properties:
        error: {type: string, examples: [Invalid symbol.]}
      required: [error]
    RateLimitError:
      type: object
      properties:
        error: {type: string}
        retryAfter: {type: string}
