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

# allMids | Hyperliquid info

> Retrieves mid prices for all available coins on the Hyperliquid exchange. If the order book is empty, the last trade price is used as a fallback.

<Info>
  You can only use this endpoint on the official Hyperliquid public API. It is not available through Chainstack, as the open-source node implementation does not support it yet. See [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

Retrieves mid prices for all available coins on the Hyperliquid exchange. If the order book is empty, the last trade price is used as a fallback.

## Parameters

* `type` (string, required) — Must be `"allMids"`
* `dex` (string, optional) — Perp dex name. Defaults to empty string (first perp dex). Spot mids are only included with the first perp dex

## Returns

Returns an object with coin symbols as keys and mid prices as string values.

<Note>
  Mid price = (best bid + best ask) ÷ 2. When the order book is empty, the last trade price is used as fallback.
</Note>

<Info>
  The response may also include internal index keys like `"@142"` alongside human‑readable symbols (for example, `"BTC"`, `"ETH"`). Use symbol keys for application logic and ignore `"@..."` keys if not needed.
</Info>

## Example request

<CodeGroup>
  ```shell Shell theme={"system"}
  curl -X POST \
    -H "Content-Type: application/json" \
    -d '{
      "type": "allMids",
      "dex": ""
    }' \
    https://api.hyperliquid.xyz/info
  ```

  ```python Python (hyperliquid-python-sdk) theme={"system"}
  from hyperliquid.info import Info
  from hyperliquid.utils import constants

  # allMids is a public-only method — use the official Hyperliquid API URL.
  info = Info(constants.MAINNET_API_URL, skip_ws=True)

  # Posts {"type": "allMids", "dex": ""} to /info
  mids = info.all_mids()
  print(mids)
  ```

  ```typescript TypeScript (@nktkas/hyperliquid) theme={"system"}
  import { HttpTransport, InfoClient } from "@nktkas/hyperliquid";

  // allMids is a public-only method — the default transport targets the official Hyperliquid API.
  const transport = new HttpTransport();
  const info = new InfoClient({ transport });

  // Posts {"type": "allMids"} to /info
  const mids = await info.allMids();
  console.log(mids);
  ```
</CodeGroup>

## Use cases

* **Price discovery** — Get current market prices for all available assets
* **Portfolio valuation** — Calculate total portfolio value using current prices
* **Trading interfaces** — Display real-time prices in dashboards
* **Market monitoring** — Track price movements across all markets


## OpenAPI

````yaml openapi/hyperliquid_node_api/hypercore_info/info_allmids.json post /info
openapi: 3.0.0
info:
  title: Hyperliquid Node API
  version: 1.0.0
  description: This is an API for interacting with Chainstack Hyperliquid node.
servers:
  - url: https://api.hyperliquid.xyz
security: []
paths:
  /info:
    post:
      tags:
        - hyperliquid operations
      summary: info (allMids)
      operationId: infoAllMids
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  default: allMids
                  enum:
                    - allMids
                  description: Request type to retrieve mid prices for all coins
                dex:
                  type: string
                  default: ''
                  description: >-
                    Perp dex name. Defaults to the empty string which represents
                    the first perp dex. Spot mids are only included with the
                    first perp dex.
              required:
                - type
      responses:
        '200':
          description: Mid prices for all available coins
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Object containing mid prices for all coins with coin symbols
                  as keys and prices as values
                additionalProperties:
                  type: string
                  description: Mid price for the coin as a string
                example:
                  '@142': '116849.5'
                  BTC: '116845.5'
                  ETH: '3915.35'
                  HYPE: '40.7915'

````