> ## 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.

> [card] Credit Cost
>
> 1 per call

> [card] Processing
>
> Realtime

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](https://goldrush.dev/docs/pricing-calculator.md?endpoint=%2Fapi-reference%2Fhyperliquid-info%2Fall-mids).

> [!NOTE]
>
> * 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 [spotMeta](https://goldrush.dev/docs/api-reference/hyperliquid-info/spot-meta.md).
> * 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.

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.

## Endpoint

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

## Request

**type** `string` *required* (default: allMids)

Always `"allMids"`.

**dex** `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.

### Example

```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()
```

## 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.

**\{coin}** `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`.

## Related endpoints

> [card] [candleSnapshot](https://goldrush.dev/docs/api-reference/hyperliquid-info/candle-snapshot.md)
>
> fetch historical OHLCV candles for a coin and interval over a time window for charting and backtesting.

> [card] [fundingHistory](https://goldrush.dev/docs/api-reference/hyperliquid-info/funding-history.md)
>
> fetch a coin’s historical funding rates and premiums over a time window for funding analytics and basis strategies.

> [card] [l2Book](https://goldrush.dev/docs/api-reference/hyperliquid-info/l2-book.md)
>
> fetch an aggregated Level-2 order book snapshot for a single coin - bids and asks as price, size, and order-count levels.

> [card] [l2BookDiffSnapshot](https://goldrush.dev/docs/api-reference/hyperliquid-info/l2-book-diff-snapshot.md)
>
> fetch a full-depth L2 order book snapshot for one coin, with height, epoch, and seq to bootstrap the l2BookDiff2 stream.

See all Hyperliquid endpoints: [Overview hub](https://goldrush.dev/docs/goldrush-hyperliquid/overview.md) · [Info API reference](https://goldrush.dev/docs/goldrush-hyperliquid/info-api/overview.md)

*Last reviewed: 2026-08-17*


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