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

# Hyperliquid

> Market data (mid prices, order books, candles, funding) and public account state from the Hyperliquid exchange's keyless info endpoint.

![](https://mintcdn.com/webrouter/JBFYvcRI1PVnd4YX/logo/data-apis/hyperliquid.webp?fit=max\&auto=format\&n=JBFYvcRI1PVnd4YX\&q=85\&s=b40ee0f2dbcb59d2e23c56b8b22f708a)

[Web Catalog · Finance](https://docs.webrouter.net/data-apis.md?category=finance)

No key needed

Endpoints

7

Auth

None

[Vendor docs](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint)

## Notes

* Keyless. Every read is a POST to /info with a JSON body whose 'type' picks the query; reads over POST change nothing.
* Timestamps (startTime, endTime and every time in answers) are epoch MILLISECONDS. Prices and sizes come back as strings.
* Coin names: a perp is its name from meta (BTC); a spot pair is PURR/USDC for PURR and @\{index} for others, the index being the pair's position in spotMeta's universe; HIP-3 perps carry the dex prefix (xyz:XYZ100).
* Time-range answers are capped (500 elements per the general docs, 2000 for fills); page by sending the last returned timestamp as the next startTime.
* For an account query, use the master or sub-account address, not an agent wallet's address, or the answer is empty.

## Endpoints

POST

Get mid prices of all coins

The current mid price of every coin, keyed by coin name.

[Open](#hyperliquid-mids-all)

POST

Get a coin's order book

Level-2 order book snapshot of one coin, up to 20 levels per side.

[Open](#hyperliquid-book-l2)

POST

Get candles for a coin

OHLCV candles of one coin over a time range.

[Open](#hyperliquid-candles)

POST

Get perpetuals metadata and market contexts

The perp universe (names, size decimals, max leverage) with each asset's mark price, funding, open interest and volume.

[Open](#hyperliquid-perps-meta-and-contexts)

POST

Get a coin's funding rate history

Historical funding rates of one perp over a time range.

[Open](#hyperliquid-funding-history)

POST

Get an account's perp positions and margin

Open perp positions, margin summary and withdrawable balance of one address.

[Open](#hyperliquid-account-state)

POST

Get an account's fills over a time range

Trade fills of one address between two times.

[Open](#hyperliquid-account-fills)

### Get mid prices of all coins

POST

`/info`

`hyperliquid.mids.all`

The current mid price of every coin, keyed by coin name.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`type` required</td><td>string</td><td>body</td><td>Must be allMids. One of `allMids` Example `allMids`</td></tr>

    <tr>
      <td>
        `dex`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        Perp dex name; empty or omitted is the first perp dex. Spot mids appear only with the first perp dex.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint) · Same job: [Alpha Vantage](https://docs.webrouter.net/data-apis/alphavantage.md#alphavantage-crypto-daily), [Binance](https://docs.webrouter.net/data-apis/binance.md#binance-ticker-price), [Coinbase Exchange](https://docs.webrouter.net/data-apis/coinbase-exchange.md#coinbase-exchange-ticker-get), [CoinGecko](https://docs.webrouter.net/data-apis/coingecko.md#coingecko-price-simple), [CoinMarketCap](https://docs.webrouter.net/data-apis/coinmarketcap.md#coinmarketcap-cryptocurrency-listings-latest), [CryptoCompare](https://docs.webrouter.net/data-apis/cryptocompare.md#cryptocompare-index-latest-tick)

```python Python theme={null}
router.call_data_api("hyperliquid.mids.all", {'type': 'allMids'})
```

```text MCP theme={null}
call_data_api(endpoint="hyperliquid.mids.all", params={"type": "allMids"})
```

> [!NOTE]
>
> * A read over POST. Falls back to the last trade price when a book is empty.

### Get a coin's order book

POST

`/info`

`hyperliquid.book.l2`

Level-2 order book snapshot of one coin, up to 20 levels per side.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`type` required</td><td>string</td><td>body</td><td>Must be l2Book. One of `l2Book` Example `l2Book`</td></tr>
    <tr><td>`coin` required</td><td>string</td><td>body</td><td>Coin name (see the vendor notes for spot and HIP-3 naming). Example `BTC`</td></tr>
    <tr><td>`nSigFigs`</td><td>integer</td><td>body</td><td>Aggregate levels to this many significant figures: 2, 3, 4 or 5 (null for full precision). One of `2`, `3`, `4`, `5`</td></tr>
    <tr><td>`mantissa`</td><td>integer</td><td>body</td><td>1, 2 or 5; allowed only when nSigFigs is 5. One of `1`, `2`, `5`</td></tr>
  </tbody>
</table>

[Vendor docs](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint) · Same job: [Alpha Vantage](https://docs.webrouter.net/data-apis/alphavantage.md#alphavantage-quote), [Binance](https://docs.webrouter.net/data-apis/binance.md#binance-ticker-24hr), [Coinbase Exchange](https://docs.webrouter.net/data-apis/coinbase-exchange.md#coinbase-exchange-stats-get), [CoinMarketCap](https://docs.webrouter.net/data-apis/coinmarketcap.md#coinmarketcap-global-metrics-latest), [Commodity Price API](https://docs.webrouter.net/data-apis/commoditypriceapi.md#commoditypriceapi-rates-latest), [EODHD](https://docs.webrouter.net/data-apis/eodhd.md#eodhd-live-quote)

```python Python theme={null}
router.call_data_api("hyperliquid.book.l2", {'type': 'l2Book', 'coin': 'BTC'})
```

```text MCP theme={null}
call_data_api(endpoint="hyperliquid.book.l2", params={"type": "l2Book", "coin": "BTC"})
```

> [!NOTE]
>
> * A read over POST.

### Get candles for a coin

POST

`/info`

`hyperliquid.candles`

OHLCV candles of one coin over a time range.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`type` required</td><td>string</td><td>body</td><td>Must be candleSnapshot. One of `candleSnapshot` Example `candleSnapshot`</td></tr>
    <tr><td>`req` required</td><td>object</td><td>body</td><td>\{coin, interval, startTime, endTime}; times in epoch ms. Intervals: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d, 3d, 1w, 1M. Example `{"coin": "BTC", "interval": "1h", "startTime": 1700000000000, "endTime": 1700086400000}`</td></tr>
  </tbody>
</table>

[Vendor docs](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint) · Same job: [Alpha Vantage](https://docs.webrouter.net/data-apis/alphavantage.md#alphavantage-daily), [Bank of Canada](https://docs.webrouter.net/data-apis/bankofcanada.md#bankofcanada-observations-series), [Bank of England](https://docs.webrouter.net/data-apis/bankofengland.md#bankofengland-series-csv), [Binance](https://docs.webrouter.net/data-apis/binance.md#binance-klines), [Coinbase Exchange](https://docs.webrouter.net/data-apis/coinbase-exchange.md#coinbase-exchange-candles-get), [CoinGecko](https://docs.webrouter.net/data-apis/coingecko.md#coingecko-coins-market-chart)

```python Python theme={null}
router.call_data_api("hyperliquid.candles", {'type': 'candleSnapshot', 'req': {'coin': 'BTC', 'interval': '1h', 'startTime': 1700000000000, 'endTime': 1700086400000}})
```

```text MCP theme={null}
call_data_api(endpoint="hyperliquid.candles", params={"type": "candleSnapshot", "req": {"coin": "BTC", "interval": "1h", "startTime": 1700000000000, "endTime": 1700086400000}})
```

> [!NOTE]
>
> * A read over POST. Only the 5,000 most recent candles of an interval are available.

### Get perpetuals metadata and market contexts

POST

`/info`

`hyperliquid.perps.meta_and_contexts`

The perp universe (names, size decimals, max leverage) with each asset's mark price, funding, open interest and volume.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`type` required</td><td>string</td><td>body</td><td>Must be metaAndAssetCtxs. One of `metaAndAssetCtxs` Example `metaAndAssetCtxs`</td></tr>

    <tr>
      <td>
        `dex`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        Perp dex name; empty or omitted is the first perp dex.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals) · Same job: [Alpha Vantage](https://docs.webrouter.net/data-apis/alphavantage.md#alphavantage-quote), [Binance](https://docs.webrouter.net/data-apis/binance.md#binance-ticker-24hr), [Coinbase Exchange](https://docs.webrouter.net/data-apis/coinbase-exchange.md#coinbase-exchange-stats-get), [CoinMarketCap](https://docs.webrouter.net/data-apis/coinmarketcap.md#coinmarketcap-global-metrics-latest), [Commodity Price API](https://docs.webrouter.net/data-apis/commoditypriceapi.md#commoditypriceapi-rates-latest), [EODHD](https://docs.webrouter.net/data-apis/eodhd.md#eodhd-live-quote)

```python Python theme={null}
router.call_data_api("hyperliquid.perps.meta_and_contexts", {'type': 'metaAndAssetCtxs'})
```

```text MCP theme={null}
call_data_api(endpoint="hyperliquid.perps.meta_and_contexts", params={"type": "metaAndAssetCtxs"})
```

> [!NOTE]
>
> * A read over POST.

### Get a coin's funding rate history

POST

`/info`

`hyperliquid.funding.history`

Historical funding rates of one perp over a time range.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`type` required</td><td>string</td><td>body</td><td>Must be fundingHistory. One of `fundingHistory` Example `fundingHistory`</td></tr>
    <tr><td>`coin` required</td><td>string</td><td>body</td><td>Perp name. Example `ETH`</td></tr>
    <tr><td>`startTime` required</td><td>integer</td><td>body</td><td>Start, epoch ms, inclusive. Example `1700000000000`</td></tr>

    <tr>
      <td>
        `endTime`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        End, epoch ms, inclusive; defaults to now.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals) · Same job: [Alpha Vantage](https://docs.webrouter.net/data-apis/alphavantage.md#alphavantage-daily), [Bank of Canada](https://docs.webrouter.net/data-apis/bankofcanada.md#bankofcanada-observations-series), [Bank of England](https://docs.webrouter.net/data-apis/bankofengland.md#bankofengland-series-csv), [Binance](https://docs.webrouter.net/data-apis/binance.md#binance-klines), [Coinbase Exchange](https://docs.webrouter.net/data-apis/coinbase-exchange.md#coinbase-exchange-candles-get), [CoinGecko](https://docs.webrouter.net/data-apis/coingecko.md#coingecko-coins-market-chart)

```python Python theme={null}
router.call_data_api("hyperliquid.funding.history", {'type': 'fundingHistory', 'coin': 'ETH', 'startTime': 1700000000000})
```

```text MCP theme={null}
call_data_api(endpoint="hyperliquid.funding.history", params={"type": "fundingHistory", "coin": "ETH", "startTime": 1700000000000})
```

> [!NOTE]
>
> * A read over POST. Capped per answer; page from the last returned time.

### Get an account's perp positions and margin

POST

`/info`

`hyperliquid.account.state`

Open perp positions, margin summary and withdrawable balance of one address.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`type` required</td><td>string</td><td>body</td><td>Must be clearinghouseState. One of `clearinghouseState` Example `clearinghouseState`</td></tr>
    <tr><td>`user` required</td><td>string</td><td>body</td><td>42-character hex address of the master or sub-account. Example `0x0000000000000000000000000000000000000000`</td></tr>

    <tr>
      <td>
        `dex`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        Perp dex name; empty or omitted is the first perp dex.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals) · Same job: [Alchemy](https://docs.webrouter.net/data-apis/alchemy.md#alchemy-token-balances), [Etherscan](https://docs.webrouter.net/data-apis/etherscan.md#etherscan-account-balance), [GoldRush (formerly Covalent)](https://docs.webrouter.net/data-apis/goldrush.md#goldrush-balances-tokens), [mempool.space](https://docs.webrouter.net/data-apis/mempool-space.md#mempool-space-address-get), [Moralis](https://docs.webrouter.net/data-apis/moralis.md#moralis-wallet-tokens)

```python Python theme={null}
router.call_data_api("hyperliquid.account.state", {'type': 'clearinghouseState', 'user': '0x0000000000000000000000000000000000000000'})
```

```text MCP theme={null}
call_data_api(endpoint="hyperliquid.account.state", params={"type": "clearinghouseState", "user": "0x0000000000000000000000000000000000000000"})
```

> [!NOTE]
>
> * A read over POST. Public data: any address can be queried.

### Get an account's fills over a time range

POST

`/info`

`hyperliquid.account.fills`

Trade fills of one address between two times.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`type` required</td><td>string</td><td>body</td><td>Must be userFillsByTime. One of `userFillsByTime` Example `userFillsByTime`</td></tr>
    <tr><td>`user` required</td><td>string</td><td>body</td><td>42-character hex address. Example `0x0000000000000000000000000000000000000000`</td></tr>
    <tr><td>`startTime` required</td><td>integer</td><td>body</td><td>Start, epoch ms, inclusive. Example `1700000000000`</td></tr>

    <tr>
      <td>
        `endTime`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        End, epoch ms, inclusive; defaults to now.
      </td>
    </tr>

    <tr>
      <td>
        `aggregateByTime`
      </td>

      <td>
        boolean
      </td>

      <td>
        body
      </td>

      <td>
        Combine partial fills of one crossing order.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint) · Same job: [Alchemy](https://docs.webrouter.net/data-apis/alchemy.md#alchemy-token-balances), [Etherscan](https://docs.webrouter.net/data-apis/etherscan.md#etherscan-account-balance), [GoldRush (formerly Covalent)](https://docs.webrouter.net/data-apis/goldrush.md#goldrush-balances-tokens), [mempool.space](https://docs.webrouter.net/data-apis/mempool-space.md#mempool-space-address-get), [Moralis](https://docs.webrouter.net/data-apis/moralis.md#moralis-wallet-tokens)

```python Python theme={null}
router.call_data_api("hyperliquid.account.fills", {'type': 'userFillsByTime', 'user': '0x0000000000000000000000000000000000000000', 'startTime': 1700000000000})
```

```text MCP theme={null}
call_data_api(endpoint="hyperliquid.account.fills", params={"type": "userFillsByTime", "user": "0x0000000000000000000000000000000000000000", "startTime": 1700000000000})
```

> [!NOTE]
>
> * A read over POST. At most 2,000 fills per answer, and only the 10,000 most recent fills are reachable.


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