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

# Info API Migration Guide

> Switch from Hyperliquid's public /info API to Uniblock by changing one URL and adding your API key — request and response shapes stay identical.

Migrating from Hyperliquid's public `/info` API to Uniblock is a two-line change: point at Uniblock's endpoint and add your API key. Because Uniblock forwards the native `/info` contract verbatim, **every request body and response shape you already use stays the same**.

<Info>
  Grab your API key from the
  [Uniblock dashboard](https://dashboard.uniblock.dev) before you start.
</Info>

## What changes

|                   | Public Hyperliquid                         | Uniblock                                                       |
| ----------------- | ------------------------------------------ | -------------------------------------------------------------- |
| **URL**           | `https://api.hyperliquid.xyz/info`         | `https://api.uniblock.dev/uni/v1/hyperliquid/info?chainId=999` |
| **Auth**          | none                                       | `x-api-key: YOUR_API_KEY` header                               |
| **Testnet**       | `https://api.hyperliquid-testnet.xyz/info` | add `chainId=998`                                              |
| **Request body**  | unchanged                                  | unchanged                                                      |
| **Response body** | unchanged                                  | unchanged                                                      |
| **Rate limits**   | request-weight cap per IP                  | no per-IP cap, but plan-level limits apply                     |

Everything else — the `type` discriminator, operation-specific fields, and the JSON you get back — is identical.

## Before and after

<CodeGroup>
  ```bash Public /info theme={null}
  curl --location 'https://api.hyperliquid.xyz/info' \
    --header 'Content-Type: application/json' \
    --data '{
      "type": "clearinghouseState",
      "user": "0x0000000000000000000000000000000000000000"
    }'
  ```

  ```bash Uniblock 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"
    }'
  ```
</CodeGroup>

## Migrate in code

If you build requests in application code, change the base URL and inject the header once:

```javascript theme={null}
// Before
const BASE_URL = "https://api.hyperliquid.xyz/info";
async function info(body) {
  const res = await fetch(BASE_URL, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(body),
  });
  return res.json();
}

// After
const BASE_URL = "https://api.uniblock.dev/uni/v1/hyperliquid/info?chainId=999";
async function info(body) {
  const res = await fetch(BASE_URL, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": process.env.UNIBLOCK_API_KEY, // the only new line
    },
    body: JSON.stringify(body),
  });
  return res.json();
}
```

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

# Before: "https://api.hyperliquid.xyz/info"
BASE_URL = "https://api.uniblock.dev/uni/v1/hyperliquid/info"

def info(body):
    res = requests.post(
        BASE_URL,
        params={"chainId": 999},
        headers={"x-api-key": os.environ["UNIBLOCK_API_KEY"]},
        json=body,
    )
    return res.json()
```

## After migrating

* The public per-IP request-weight cap no longer applies, but **keep your retry/backoff logic** — Uniblock enforces plan-level rate limits and returns `429` when your project exceeds them (backup routing does not bypass this). See [Rate Limits & Caching](/guides/hyperliquid/info-api/limits) and [error codes](/guides/uniblock/error-codes#rate-limits).
* Consider Uniblock's synthetic types (`portfolioState`, `batchClearinghouseStates`, `batchPortfolioStates`) to replace multiple round-trips with one request. See the [Info API overview](/guides/hyperliquid/info-api/overview).
* Using an off-the-shelf Hyperliquid SDK? See [SDK Compatibility](/guides/hyperliquid/info-api/sdk-compatibility).
