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

# Query HyperEVM

> Make your first HyperEVM JSON-RPC call on Uniblock in under two minutes, with raw requests or a standard EVM library.

Estimated time: under two minutes. This guide assumes you already have an Uniblock project — if not, follow the [Uniblock Quickstart Guide](/guides/getting-started/uniblock-quickstart-guide) first.

<Info>
  Replace `YOUR_API_KEY` with the key from your
  [Uniblock dashboard](https://dashboard.uniblock.dev). Use `chainId=999` for
  mainnet or `998` for testnet.
</Info>

## Raw JSON-RPC

Read the latest HyperEVM block number:

<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()); // { jsonrpc: "2.0", id: 1, result: "0x..." }
  ```
</CodeGroup>

## With a standard EVM library

Because HyperEVM speaks standard JSON-RPC, point any EVM library at the Uniblock endpoint. The `x-api-key` header travels in the transport config.

<CodeGroup>
  ```javascript viem theme={null}
  import { createPublicClient, http } from "viem";

  const client = createPublicClient({
    transport: http("https://api.uniblock.dev/uni/v1/json-rpc?chainId=999", {
      fetchOptions: { headers: { "x-api-key": "YOUR_API_KEY" } },
    }),
  });

  console.log(await client.getBlockNumber());
  ```

  ```javascript ethers theme={null}
  import { JsonRpcProvider, FetchRequest } from "ethers";

  const req = new FetchRequest(
    "https://api.uniblock.dev/uni/v1/json-rpc?chainId=999",
  );
  req.setHeader("x-api-key", "YOUR_API_KEY");

  const provider = new JsonRpcProvider(req);
  console.log(await provider.getBlockNumber());
  ```
</CodeGroup>

## Next steps

* Browse every method group in the [HyperEVM overview](/guides/hyperliquid/evm/overview).
* See the full method reference in the [Hyperliquid (HYPE) JSON-RPC docs](/reference/jsonrpc/999/hyperliquid-overview).
* Need the native order book instead of the EVM layer? Use the [Info API](/guides/hyperliquid/info-api/overview) or [WebSockets](/guides/hyperliquid/websockets/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>
