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

# Get market history

> Get up to 24 hours of one-minute price history for one side of a market.

No API key required.



## OpenAPI

````yaml /hyperliquid/openapi.json get /v1/markets/{outcome_id}/history
openapi: 3.1.1
info:
  title: Totalis Hyperliquid API
  description: >-
    REST API for Totalis singles and parlays on Hyperliquid HIP-4 outcome
    markets, for client integrations and external market makers.


    Authenticate with a scoped API key created in the Totalis app, sent as
    `Authorization: Bearer <key>`. Public market reads need no key.
    Balance-affecting commands also carry the wallet or maker signature the
    HyperEVM contract verifies.


    Amounts are base-10 strings in native USDC atomic units, large identifiers
    are decimal strings, and every command `POST` requires an `Idempotency-Key`
    header.


    Every error is `{error: {code, message, retry, request_id,
    field_violations}}`. `code` is stable; each operation lists the codes it
    returns per status. `retry` is `NEVER` (stop), `BACKOFF` (resend the same
    request with the same `Idempotency-Key` after `Retry-After` seconds) or
    `REFRESH` (re-read state, then send a new request with a new key).
    `field_violations` names invalid inputs by JSON pointer, such as
    `/legs/0/side`.
  version: 127.0.0-pure-reads
servers:
  - url: https://hip4-api.totalis.trade
    description: Production public edge
  - url: https://hip4-api-staging.totalis.trade
    description: Staging and chain-998 public edge
security: []
tags:
  - name: Markets
    description: HIP-4 markets, their sides and price history. No API key needed.
  - name: RFQs & Quotes
    description: >-
      RFQs and the quotes that answer them: what a taker calls, then what a
      maker calls.
  - name: Positions
    description: Positions the account holds, or its maker backs.
  - name: Account
    description: >-
      The account a key acts for: identity, balances, activity, operations and
      withdrawals.
  - name: Makers
    description: 'The rest of a maker''s setup after Making: capital and collateral.'
  - name: Deployment
    description: The contract deployment every signature is made against.
  - name: WebSocket
    description: The authenticated WebSocket for account and maker updates.
paths:
  /v1/markets/{outcome_id}/history:
    parameters:
      - $ref: '#/components/parameters/OutcomeId'
    get:
      tags:
        - Markets
      summary: Get market history
      description: |-
        Get up to 24 hours of one-minute price history for one side of a market.

        No API key required.
      operationId: getMarketHistory
      parameters:
        - $ref: '#/components/parameters/Side'
        - $ref: '#/components/parameters/HistorySeries'
        - $ref: '#/components/parameters/From'
        - $ref: '#/components/parameters/To'
        - $ref: '#/components/parameters/Cursor'
        - $ref: '#/components/parameters/HistoryLimit'
        - $ref: '#/components/parameters/HistoryIncludeGaps'
      responses:
        '200':
          description: >-
            Exactly one labelled, sparse series: reference prices or trades.
            Only minutes that closed before `closed_before` are returned; take
            the current minute from the live market stream. Later pages reuse
            the window this first response returns.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketHistory'
              example:
                outcome_id: '1209'
                side: 'YES'
                series_type: TRADE_OHLCV
                source: HYPERLIQUID_TRADES
                quality: TRADE
                scale: '1000000000000000000'
                volume_scale: '1000000000000000000'
                from: '2026-09-25T20:00:07.998164544Z'
                to: '2026-09-26T20:00:07.998164544Z'
                bucket_time: HYPERLIQUID_SOURCE_TIME
                closed_before: '2026-09-26T20:00:00Z'
                anchor:
                  minute: '2026-09-25T19:46:00Z'
                  open: '330000000000000000'
                  high: '330000000000000000'
                  low: '330000000000000000'
                  close: '330000000000000000'
                  volume: '39000000000000000000'
                  trade_count: 1
                bars:
                  - minute: '2026-09-25T20:05:00Z'
                    open: '304510000000000000'
                    high: '304510000000000000'
                    low: '304510000000000000'
                    close: '304510000000000000'
                    volume: '40000000000000000000'
                    trade_count: 1
                  - minute: '2026-09-25T20:36:00Z'
                    open: '330900000000000000'
                    high: '330900000000000000'
                    low: '328100000000000000'
                    close: '328100000000000000'
                    volume: '67000000000000000000'
                    trade_count: 2
                  - minute: '2026-09-25T20:37:00Z'
                    open: '326010000000000000'
                    high: '326010000000000000'
                    low: '326010000000000000'
                    close: '326010000000000000'
                    volume: '40000000000000000000'
                    trade_count: 1
                gaps:
                  - outcome_id: '1209'
                    source: HYPERLIQUID_TRADES
                    catalog_generation: '5770'
                    feed_generation: '1790366409618'
                    from: '2026-09-25T20:00:09.600639Z'
                    to: '2026-09-25T20:00:09.61714Z'
                    reason: SOURCE_UNAVAILABLE
                  - outcome_id: '1209'
                    source: HYPERLIQUID_TRADES
                    catalog_generation: '5771'
                    feed_generation: '1790366410587'
                    from: '2026-09-25T20:00:10.56027Z'
                    to: '2026-09-25T20:00:10.586751Z'
                    reason: SOURCE_UNAVAILABLE
                next_cursor: >-
                  AQAABLkAGNiowyaFzkAY2PdXt9TOQBjYqsYsGzgAAAABoNpC2_8AAAAAAAAWugUEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADeC2s6dkAAA
                has_more: true
        '400':
          description: >-
            - `INVALID_REQUEST` (retry `NEVER`): The body, a path parameter or a
            header is malformed or fails validation. `field_violations` names
            invalid body fields.

            - `INVALID_QUERY` (retry `NEVER`): A query parameter is malformed,
            out of range or not accepted by this operation. `field_violations`
            names it.

            - `INVALID_CURSOR` (retry `NEVER`): The cursor is malformed or was
            issued for a different query.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
        '404':
          description: >-
            - `NOT_FOUND` (retry `NEVER`): The resource does not exist or is not
            visible to this credential.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
        '503':
          description: >-
            - `MARKET_DATA_UNAVAILABLE` (retry `BACKOFF`): No complete market
            catalog is available.
          headers:
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
      security:
        - {}
components:
  parameters:
    OutcomeId:
      name: outcome_id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/UInt32String'
      description: HIP-4 outcome ID of the market, as a decimal string.
      example: '1209'
    Side:
      name: side
      in: query
      required: true
      schema:
        type: string
        enum:
          - 'YES'
          - 'NO'
      description: Outcome side whose price history is returned.
      example: 'YES'
    HistorySeries:
      name: series
      in: query
      description: >-
        Use `REFERENCE_PRICE_OHLC` for a line chart and `TRADE_OHLCV` for
        candles; `AUTO` uses trades when there are any. AUTO selects retained
        closed trade buckets in the window, otherwise reference history.
        REFERENCE_PRICE_OHLC prefers L2, then BBO, then allMids among sources
        with a closed bucket in the window; with none it carries the most recent
        earlier source inside the 90-day online window, breaking ties in that
        order. With no evidence the empty reference response is labelled
        L2/BOOK_MID. Explicit series avoids AUTO switching when trades arrive.
      schema:
        type: string
        enum:
          - AUTO
          - REFERENCE_PRICE_OHLC
          - TRADE_OHLCV
        default: AUTO
      example: AUTO
    From:
      name: from
      in: query
      description: >-
        Inclusive RFC3339 window start. Omit from and to together for the exact
        rolling 24 hours ending at server time; supplying only one is rejected.
        The response repeats the resolved bounds, which later pages must reuse.
      schema:
        type: string
        format: date-time
      example: '2026-09-25T12:00:00Z'
    To:
      name: to
      in: query
      description: >-
        Exclusive RFC3339 window end, at most 24 hours after from. Omit from and
        to together for the server default.
      schema:
        type: string
        format: date-time
      example: '2026-09-26T12:00:00Z'
    Cursor:
      name: cursor
      in: query
      description: >-
        Omit for the first page; then send the previous response's next_cursor
        unchanged.
      schema:
        $ref: '#/components/schemas/PageCursor'
      example: eyJ2IjoxLCJzIjoiMTIzNDUifQ
    HistoryLimit:
      name: limit
      in: query
      description: >-
        The shared page limit with one exception: the maximum is 1,440, a full
        24-hour window of one-minute bars, so a chart loads in one request.
      schema:
        type: integer
        minimum: 1
        maximum: 1440
        default: 50
      example: 1440
    HistoryIncludeGaps:
      name: include_gaps
      in: query
      description: >-
        Include at most 1440 retained diagnostic gap records; gaps is empty
        unless this is true.
      schema:
        type: boolean
        default: false
      example: false
  schemas:
    MarketHistory:
      type: object
      additionalProperties: false
      required:
        - outcome_id
        - side
        - series_type
        - source
        - quality
        - scale
        - volume_scale
        - from
        - to
        - bucket_time
        - closed_before
        - anchor
        - bars
        - gaps
        - next_cursor
        - has_more
      properties:
        outcome_id:
          $ref: '#/components/schemas/UInt32String'
          description: Hyperliquid outcome ID of the market.
        side:
          $ref: '#/components/schemas/Side'
          description: Market side every bar describes, YES or NO.
        series_type:
          type: string
          enum:
            - TRADE_OHLCV
            - REFERENCE_PRICE_OHLC
          description: >-
            TRADE_OHLCV: bars are one-minute OHLCV of executed trade prices,
            with base-size volume. REFERENCE_PRICE_OHLC: bars are one-minute
            OHLC of indicative mid prices, falling back to the last trade,
            without volume. Minutes without observations have no bar and are
            never filled in.
        source:
          $ref: '#/components/schemas/Source'
          description: >-
            Hyperliquid feed every bar in the response was built from. Always
            HYPERLIQUID_TRADES for trade history.
        quality:
          $ref: '#/components/schemas/Quality'
          description: >-
            Price quality every bar in the response carries. Always TRADE for
            trade history.
        scale:
          oneOf:
            - $ref: '#/components/schemas/Scale'
            - type: 'null'
          description: >-
            Divisor for open, high, low and close of every bar and the anchor;
            null when there are neither. Currently 1000000000000000000 (18
            decimals); a scale change starts a new page.
        volume_scale:
          oneOf:
            - $ref: '#/components/schemas/Scale'
            - type: 'null'
          description: >-
            Divisor for volume of every bar and the anchor; null for
            reference-price history or when there are no bars. Divisor for
            volume; null only when there are no bars. Always null;
            reference-price bars carry no volume.
        from:
          $ref: '#/components/schemas/CommonTimestamp'
          description: >-
            Authoritative window start. It repeats the request, or the rolling
            24-hour default when from and to are both omitted. Reuse these
            bounds for later pages.
        to:
          $ref: '#/components/schemas/CommonTimestamp'
          description: >-
            Authoritative exclusive window end. It repeats the request, or the
            request time when from and to are both omitted. Reuse these bounds
            for later pages.
        bucket_time:
          type: string
          enum:
            - TOTALIS_RECEIVED_AT
            - HYPERLIQUID_SOURCE_TIME
          description: >-
            minute is the inclusive UTC bucket start on this clock; bucket end
            is exclusive one minute later. Only full closed buckets contained in
            [from,to) appear in bars.
        closed_before:
          $ref: '#/components/schemas/CommonTimestamp'
          description: >-
            Exclusive bucket boundary, the earlier of to or server time rounded
            down to a minute. This is not a persistence or coverage watermark.
            Closed buckets can still be repaired.
        anchor:
          oneOf:
            - $ref: '#/components/schemas/HistoryBar'
            - type: 'null'
          description: >-
            Latest retained earlier full bucket within the 90-day online window
            for the selected source and side, last received before from. Its
            close is an observed price, not proof that the value held through
            from. Null when there is none or its scale differs from the bars.
        bars:
          type: array
          maxItems: 1440
          items:
            $ref: '#/components/schemas/HistoryBar'
          description: Closed one-minute bars in the window, ascending by minute.
        gaps:
          type: array
          maxItems: 1440
          items:
            $ref: '#/components/schemas/HistoryGap'
          description: >-
            Recorded data gaps overlapping the window; empty unless gaps were
            requested.
        next_cursor:
          $ref: '#/components/schemas/NextCursor'
          description: >-
            Pass as cursor with the same from and to to read the next page; null
            when there are no more bars.
        has_more:
          type: boolean
          description: True when more bars follow in the window.
    Error:
      additionalProperties: false
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: The one error this request failed with.
      required:
        - error
      type: object
    UInt32String:
      type: string
      pattern: >-
        ^(0|[1-9][0-9]{0,8}|[1-3][0-9]{9}|4[01][0-9]{8}|42[0-8][0-9]{7}|429[0-3][0-9]{6}|4294[0-8][0-9]{5}|42949[0-5][0-9]{4}|429496[0-6][0-9]{3}|4294967[0-1][0-9]{2}|42949672[0-8][0-9]|429496729[0-5])$
      maxLength: 10
    PageCursor:
      type: string
      minLength: 1
      maxLength: 2048
      description: >-
        Opaque list cursor. Send a previous response's next_cursor back
        unchanged; never build or parse one.
    Side:
      type: string
      enum:
        - 'YES'
        - 'NO'
    Source:
      type: string
      enum:
        - HYPERLIQUID_FAST_ASSET_CTXS
        - HYPERLIQUID_ALL_MIDS
        - HYPERLIQUID_L2_BOOK
        - HYPERLIQUID_BBO
        - HYPERLIQUID_TRADES
    Quality:
      type: string
      enum:
        - BOOK_MID
        - MARK_PRICE
        - ALL_MIDS_FALLBACK
        - TRADE
    Scale:
      type: string
      pattern: ^[1-9][0-9]*$
      maxLength: 78
      format: uint256-decimal
      description: Positive base-10 scale for an integer value.
    CommonTimestamp:
      type: string
      format: date-time
      pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$
      maxLength: 30
    HistoryBar:
      type: object
      additionalProperties: false
      required:
        - minute
        - open
        - high
        - low
        - close
        - volume
        - trade_count
      properties:
        minute:
          $ref: '#/components/schemas/CommonTimestamp'
          description: >-
            Inclusive UTC start of the one-minute bucket, RFC 3339; the clock is
            given by the response's bucket_time.
        open:
          $ref: '#/components/schemas/IntegerValue'
          description: First price in the bucket, at the response's scale.
        high:
          $ref: '#/components/schemas/IntegerValue'
          description: Highest price in the bucket, at the response's scale.
        low:
          $ref: '#/components/schemas/IntegerValue'
          description: Lowest price in the bucket, at the response's scale.
        close:
          $ref: '#/components/schemas/IntegerValue'
          description: Last price in the bucket, at the response's scale.
        volume:
          oneOf:
            - $ref: '#/components/schemas/IntegerValue'
            - type: 'null'
          description: >-
            Executed base size in the bucket, divided by the response's
            volume_scale for contracts; null for reference-price bars.
        trade_count:
          oneOf:
            - type: integer
              minimum: 1
            - type: 'null'
          description: Number of trades in the bucket; null for reference-price bars.
    HistoryGap:
      type: object
      additionalProperties: false
      required:
        - outcome_id
        - source
        - catalog_generation
        - feed_generation
        - from
        - to
        - reason
      properties:
        outcome_id:
          $ref: '#/components/schemas/UInt32String'
          description: Hyperliquid outcome ID of the market.
        source:
          $ref: '#/components/schemas/Source'
          description: Hyperliquid feed whose data is missing.
        catalog_generation:
          $ref: '#/components/schemas/PositiveInt64'
          description: Catalog generation in effect when the gap was recorded.
        feed_generation:
          $ref: '#/components/schemas/PositiveInt64'
          description: Price feed generation that recorded the gap.
        from:
          $ref: '#/components/schemas/CommonTimestamp'
          description: >-
            Inclusive start of the missing interval, RFC 3339 UTC, clipped to
            the requested window.
        to:
          $ref: '#/components/schemas/CommonTimestamp'
          description: >-
            Exclusive end of the missing interval, RFC 3339 UTC, clipped to the
            requested window.
        reason:
          type: string
          enum:
            - NO_OBSERVATION
            - SOURCE_UNAVAILABLE
            - SPOOL_FULL
            - CORRUPT_SEGMENT
            - UPLOAD_FAILED
          description: >-
            Why data is missing: SOURCE_UNAVAILABLE when the feed was down,
            SPOOL_FULL when local buffering overflowed, NO_OBSERVATION,
            CORRUPT_SEGMENT or UPLOAD_FAILED for other recording losses.
    NextCursor:
      type:
        - string
        - 'null'
      minLength: 1
      maxLength: 2048
      description: Opaque cursor for the next page, or null when has_more is false.
    ErrorDetail:
      additionalProperties: false
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
          description: Stable registered code; branch on this, not on message or status.
        field_violations:
          description: >-
            Each invalid input by JSON pointer; empty when the error is not
            about a specific input.
          items:
            $ref: '#/components/schemas/FieldViolation'
          type: array
        message:
          description: Human-readable; may change without notice.
          minLength: 1
          type: string
        request_id:
          description: >-
            UUIDv7 of this request, also returned in the X-Request-ID header.
            Quote it when reporting a problem.
          format: uuid
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          type: string
        retry:
          $ref: '#/components/schemas/Retry'
          description: What the caller should do next; fixed by the registry for each code.
      required:
        - code
        - message
        - retry
        - request_id
        - field_violations
      type: object
    IntegerValue:
      type: string
      pattern: ^(0|[1-9][0-9]*)$
      maxLength: 78
      format: uint256-decimal
      description: Nonnegative integer value paired with an explicit positive scale.
    PositiveInt64:
      type: string
      pattern: ^[1-9][0-9]*$
      maxLength: 19
      format: positive-int64-decimal
      description: Positive generation or version bounded by signed int64 storage.
    ErrorCode:
      description: >-
        Stable HTTP error code. Each code has one HTTP status and one retry
        value.
      enum:
        - INVALID_REQUEST
        - INVALID_QUERY
        - INVALID_CURSOR
        - INVALID_IDEMPOTENCY_KEY
        - ORIGIN_REQUIRED
        - SUBPROTOCOL_REQUIRED
        - UNSUPPORTED_BROWSE_CONTRACT
        - UNAUTHENTICATED
        - FORBIDDEN
        - ORIGIN_NOT_ALLOWED
        - ACCESS_REQUIRED
        - NOT_FOUND
        - IDENTITY_NOT_FOUND
        - QUOTE_NOT_FOUND
        - INVITE_CODE_NOT_FOUND
        - IDEMPOTENCY_KEY_REUSED
        - STATE_CONFLICT
        - INVITE_CODE_EXHAUSTED
        - STALE_CURSOR
        - CURSOR_EXPIRED
        - CURSOR_RESET
        - RECURRING_DEFINITION_CONFLICT
        - EMBEDDED_WALLET_CONFLICT
        - SECRET_UNAVAILABLE
        - ROTATION_IN_PROGRESS
        - TELEMETRY_CONFLICT
        - RFQ_NOT_CANCELLABLE
        - RFQ_NOT_OPEN
        - RFQ_GENERATION_STALE
        - RFQ_GENERATION_IN_FLIGHT
        - QUOTE_EXPIRED
        - QUOTE_CANCELLED
        - QUOTE_REPLACED
        - QUOTE_SIGNER_CHANGED
        - QUOTE_CAPACITY_EXCEEDED
        - CORE_ACCOUNT_NOT_READY
        - CORE_EXIT_ABANDONED
        - CORE_FUNDING_CONFLICT
        - CORE_VAULT_RESERVATION
        - CORE_MOVE_IN_FLIGHT
        - INVALID_SIGNATURE
        - WRONG_AUTHORITY
        - KEY_LIMIT_REACHED
        - HYPERCORE_WALLET_UNQUALIFIED
        - HYPERCORE_ACCOUNT_NOT_MAIN
        - HYPERCORE_INSUFFICIENT_BALANCE
        - RATE_LIMITED
        - CONNECTION_LIMIT
        - RFQ_INTENT_LIMIT
        - QUOTE_EXPOSURE_LIMIT
        - DEPENDENCY_STALE
        - AUTHORIZATION_UNAVAILABLE
        - SOURCE_UNAVAILABLE
        - CONTRACT_UNAVAILABLE
        - MARKET_DATA_UNAVAILABLE
        - BROWSE_UNAVAILABLE
        - FINANCIAL_ACTIONS_DISABLED
        - CORE_FUNDING_UNAVAILABLE
        - CORE_EXIT_UNAVAILABLE
        - SPONSORSHIP_UNAVAILABLE
        - CONTRACT_SIGNATURE_OVERLOADED
        - QUOTE_EXPOSURE_STALE
        - COMBO_AUTOMATIC_DISABLED
        - EMBEDDED_WALLET_UNAVAILABLE
        - CONNECTION_DRAIN
      type: string
    FieldViolation:
      additionalProperties: false
      properties:
        code:
          description: >-
            REQUIRED: the input is missing. INVALID: it is present but malformed
            or out of range. UNEXPECTED: the input is not accepted here.
          enum:
            - REQUIRED
            - INVALID
            - UNEXPECTED
          type: string
        field:
          description: >-
            JSON pointer into the body, or into the query parameters as one flat
            object for requests without a body, for example /legs/0/stake or
            /limit.
          pattern: ^(/([^~/]|~[01])*)+$
          type: string
      required:
        - field
        - code
      type: object
    Retry:
      description: >-
        NEVER: stop. BACKOFF: resend the same request with the same
        Idempotency-Key after Retry-After. REFRESH: re-read state, then send a
        new request with a new Idempotency-Key.
      enum:
        - NEVER
        - BACKOFF
        - REFRESH
      type: string
  headers:
    RetryAfter:
      description: Seconds to wait before resending the same request
      schema:
        type: integer
        minimum: 1

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.