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

# Hyperliquid Quickstart

> Three short paths to your first Hyperliquid response on Uniblock — the Info API, a WebSocket stream, and HyperEVM JSON-RPC.

Pick the path for what you're building. Each takes about five minutes and assumes you already have an Uniblock project — if not, follow the [Uniblock Quickstart Guide](/guides/getting-started/uniblock-quickstart-guide) first to create one and copy your API key.

<Info>
  Every example below authenticates with your project API key. Replace
  `YOUR_API_KEY` with the key from your
  [Uniblock dashboard](https://dashboard.uniblock.dev).
</Info>

## Path 1 — Call the Info API

Fetch a user's perpetuals clearinghouse state with a single POST. This is Hyperliquid's public `/info` contract, routed through Uniblock.

<CodeGroup>
  ```bash cURL theme={null}
  curl --location \
    'https://api.uniblock.dev/uni/v1/hyperliquid/info?chainId=999' \
    --header 'x-api-key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "type": "clearinghouseState",
      "user": "0x0000000000000000000000000000000000000000"
    }'
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    "https://api.uniblock.dev/uni/v1/hyperliquid/info?chainId=999",
    {
      method: "POST",
      headers: {
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        type: "clearinghouseState",
        user: "0x0000000000000000000000000000000000000000",
      }),
    },
  );
  console.log(await res.json());
  ```
</CodeGroup>

Change the `type` to any Hyperliquid `/info` operation (`l2Book`, `metaAndAssetCtxs`, `spotClearinghouseState`, …) or a Uniblock synthetic type like `portfolioState`. Full details in the [Info API overview](/guides/hyperliquid/info-api/overview).

## Path 2 — Connect a WebSocket

Open one connection and subscribe to per-block order book diffs for a single asset.

```javascript theme={null}
import WebSocket from "ws";

const ws = new WebSocket("wss://websocket.uniblock.dev/goldrush", {
  headers: { "X-API-KEY": "YOUR_API_KEY" },
});

ws.on("open", () => {
  ws.send(
    JSON.stringify({
      method: "subscribe",
      subscription: { type: "l2BookDiff", coin: "HYPE" },
    }),
  );
});

ws.on("message", (raw) => console.log(JSON.parse(raw.toString())));
```

The first message per coin is a full `Snapshot`; the rest are per-block `Updates`. See the [WebSockets overview](/guides/hyperliquid/websockets/overview) for every channel and payload shape.

## Path 3 — Query HyperEVM over JSON-RPC

Read the latest HyperEVM block number with a standard `eth_blockNumber` call.

<CodeGroup>
  ```bash cURL theme={null}
  curl --location \
    'https://api.uniblock.dev/uni/v1/json-rpc?chainId=999' \
    --header 'x-api-key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "jsonrpc": "2.0",
      "method": "eth_blockNumber",
      "params": [],
      "id": 1
    }'
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    "https://api.uniblock.dev/uni/v1/json-rpc?chainId=999",
    {
      method: "POST",
      headers: {
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        jsonrpc: "2.0",
        method: "eth_blockNumber",
        params: [],
        id: 1,
      }),
    },
  );
  console.log(await res.json());
  ```
</CodeGroup>

Use `chainId=998` for testnet. Browse every method group in the [HyperEVM overview](/guides/hyperliquid/evm/overview).

***

***

<Card title="Ready to get started with Uniblock?" icon="rocket" href="https://dashboard.uniblock.dev">
  Create your free account and start building with unified blockchain infrastructure across 100+ chains.
</Card>

<Card title="View API reference" icon="book" href="/reference/unified-api-reference-overview">
  Explore all available endpoints and interactive playgrounds
</Card>
