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

# allMids | Hyperliquid Info API

> Hyperliquid allMids: fetch the current mid price for every actively traded asset in a single call.

<CardGroup cols={2}>
  <Card title="Credit Cost"> 1 per call</Card>
  <Card title="Processing"> Realtime</Card>
</CardGroup>

The Hyperliquid info endpoint with `type: "allMids"` is used to fetch the current mid price for every actively traded asset in a single call.

<Tip>
  Estimate your monthly cost for this API using the [Pricing Calculator](/docs/pricing-calculator?endpoint=%2Fapi-reference%2Fhyperliquid-info%2Fall-mids).
</Tip>

<Info>
  * Wire-equal to `POST api.hyperliquid.xyz/info` with `{"type": "allMids"}`.
  * The response is a flat map keyed by asset. Perp assets use their symbol (e.g. `BTC`); spot pairs are keyed as `@<index>` using the spot pair index from <a href="https://goldrush.dev/docs/api-reference/hyperliquid-info/spot-meta" target="_blank" rel="noopener noreferrer">spotMeta</a>.
  * The optional `dex` field takes a perp DEX name. It defaults to the empty string, which represents the first (native) perp DEX; pass a HIP-3 dex name to scope mids to that dex.
  * Mid prices are returned as decimal strings - keep them as strings or use a fixed-precision decimal type rather than parsing as floats.
</Info>

Returns the current mid price for every actively traded asset in one call. The mid price is the midpoint between the best bid and the best ask. The payload is a single JSON object mapping each asset key to its mid price as a decimal string.

This is a global, non-user-keyed type. Perp assets are keyed by their symbol (for example `BTC`); spot pairs are keyed as `@<index>`, using the spot pair index from `spotMeta`.

## Endpoint

```
POST https://hypercore.goldrushdata.com/info
Authorization: Bearer <GOLDRUSH_API_KEY>
Content-Type: application/json
```

## Request

<ParamField body="type" type="string" required default="allMids">
  Always `"allMids"`.
</ParamField>

<ParamField body="dex" type="string">
  HIP-3 builder DEX identifier. Empty string (default) returns mids for the first (native) perp DEX. Pass a builder code (e.g. `"xyz"`) to scope mids to a HIP-3 deployer's perp DEX.
</ParamField>

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://hypercore.goldrushdata.com/info \
    -H "Authorization: Bearer $GOLDRUSH_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "allMids",
      "dex": ""
    }'
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch("https://hypercore.goldrushdata.com/info", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.GOLDRUSH_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      type: "allMids",
      dex: "",
    }),
  });

  const mids = await response.json();
  ```

  ```python Python theme={null}
  import os, requests

  response = requests.post(
      "https://hypercore.goldrushdata.com/info",
      headers={"Authorization": f"Bearer {os.environ['GOLDRUSH_API_KEY']}"},
      json={"type": "allMids", "dex": ""},
  )

  mids = response.json()
  ```
</CodeGroup>

## Response

A JSON object mapping each asset key to its mid price as a decimal string.

```json theme={null}
{
  "BTC": "64000.0",
  "ETH": "3000.0",
  "@1": "1.0002"
}
```

### Field descriptions

<Note>
  All mid prices are returned as **decimal strings**, preserving upstream precision. Do not parse them as floats - keep them as strings or use a fixed-precision decimal type.
</Note>

<ResponseField name="{coin}" type="string">
  Mid price for the asset, as a decimal string. Perp assets are keyed by symbol (e.g. `BTC`, `ETH`); spot pairs are keyed as `@<index>` using the spot pair index from `spotMeta`.
</ResponseField>

*Last reviewed: 2026-07-24*
