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

# GET /depth/history — rolling order-book depth history.

> Returns up to ~3 hours of one-second order-book snapshots (10 levels per
side) for a contract. Call it once on load to paint a depth heatmap
across existing chart history immediately, then keep it current with the
live Depth WebSocket channel.

Depth of book is a separately licensed CME product: the caller must hold
the Market Depth add-on, same as the live Depth WebSocket channel.
Top-of-book users get 403 DEPTH_LICENCE_REQUIRED.



## OpenAPI

````yaml /api-reference/md-openapi.json get /md/depth/history
openapi: 3.0.3
info:
  contact:
    name: Hyperprop
    url: https://hyperprop.com
  description: >-
    # Hyperprop Market Data API


    Real-time futures market data streaming.


    ## Overview


    - **REST endpoints** for current ticker prices, OHLC, order books

    - **WebSocket** for real-time streaming with channel subscriptions

    - **JWT authentication** + CME entitlements


    ## Price Format


    Prices are **raw fixed-point integer values** (i64):

    ```text

    displayPrice = rawPrice / 1_000_000_000

    // 6010250000000 → $6010.25

    ```


    ## Authentication


    All WebSocket connections require a JWT token:

    ```http

    wss://api.hyperprop.com/md/ws/stream?token=YOUR_JWT_TOKEN

    ```


    ## CME Entitlements


    Access requires an accepted CME market data agreement and an active
    entitlement for the requested product.


    | Exchange | Symbols |

    |----------|---------|

    | CME | ES, NQ, RTY |

    | CBOT | ZC, ZS, ZW, ZB, ZN |

    | NYMEX | CL, NG, RB |

    | COMEX | GC, SI, HG |


    ## WebSocket Usage


    Connect to `/md/ws/stream` and subscribe to channels:


    ```javascript

    const ws = new
    WebSocket('wss://api.hyperprop.com/md/ws/stream?token=JWT_TOKEN');


    ws.onopen = () => {
      // Subscribe to ticker channel
      ws.send(JSON.stringify({
        action: 'subscribe',
        channel: 'ticker',
        symbols: ['ES', 'NQ']
      }));
    };


    ws.onmessage = (e) => {
      const msg = JSON.parse(e.data);
      if (msg.type === 'Price') {
        console.log(`${msg.data.symbol}: $${(msg.data.price / 1e9).toFixed(2)}`);
      }
    };

    ```
  license:
    name: Proprietary
  title: Hyperprop Market Data API
  version: 0.1.0
servers:
  - url: https://api.hyperprop.com
    description: Production
security: []
tags:
  - description: Health checks and server information
    name: System
  - description: Current ticker prices
    name: Tickers
  - description: OHLC candlestick data
    name: OHLC
  - description: Best bid/ask prices (top of book)
    name: Order Book
  - description: Historical market data (OHLC bars)
    name: Historical
  - description: Real-time streaming via WebSocket
    name: WebSocket
paths:
  /md/depth/history:
    get:
      tags:
        - Historical
      summary: GET /depth/history — rolling order-book depth history.
      description: |-
        Returns up to ~3 hours of one-second order-book snapshots (10 levels per
        side) for a contract. Call it once on load to paint a depth heatmap
        across existing chart history immediately, then keep it current with the
        live Depth WebSocket channel.

        Depth of book is a separately licensed CME product: the caller must hold
        the Market Depth add-on, same as the live Depth WebSocket channel.
        Top-of-book users get 403 DEPTH_LICENCE_REQUIRED.
      operationId: getDepthHistory
      parameters:
        - description: Full contract symbol (e.g. "NQZ6", "ESZ6"). CME futures only.
          in: query
          name: symbol
          required: true
          schema:
            type: string
        - description: |-
            How many minutes of history to return (default 180 — the full server
            retention — max 180).
          in: query
          name: minutes
          required: false
          schema:
            format: int32
            minimum: 0
            nullable: true
            type: integer
      responses:
        '200':
          content:
            application/json:
              example:
                count: 1
                snapshots:
                  - asks:
                      - - 29528500000000
                        - 8
                      - - 29528750000000
                        - 14
                    bids:
                      - - 29528250000000
                        - 12
                      - - 29528000000000
                        - 9
                    timestamp: 1786046400123
                success: true
                symbol: NQU6
              schema: {}
          description: >-
            Depth snapshots: {t: unix sec, b: [[price, size], ...], a: [[price,
            size], ...]} — display-unit prices, best level first
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoricalErrorResponse'
          description: Invalid parameters
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoricalErrorResponse'
          description: Unauthorized - missing or invalid token
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoricalErrorResponse'
          description: >-
            Forbidden - depth-of-book licence required (or CME onboarding
            incomplete)
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoricalErrorResponse'
          description: Server error
      security:
        - bearer_auth: []
components:
  schemas:
    HistoricalErrorResponse:
      description: Error response
      properties:
        code:
          type: string
        error:
          type: string
        success:
          type: boolean
      required:
        - success
        - error
        - code
      type: object

````

## Related topics

- [Changelog](/changelog.md)
- [Get order history (keyset-paginated)](/platform-api/user/get-order-history-keyset-paginated.md)
- [Get trade execution history](/trade-api/orders/get-trade-execution-history.md)
- [Get order history from database (append-only lifecycle events)](/trade-api/orders/get-order-history-from-database-append-only-lifecycle-events.md)
- [Get order book for a specific symbol](/market-data-api/order-book/get-order-book-for-a-specific-symbol.md)
