# Unichain API
> Live Unichain on-chain data via Blockscout. Unichain is Uniswap's Ethereum L2; gas and balances are in ETH. Network stats, gas prices, latest blocks, a block by height or hash, address detail with ETH balance, a transaction by hash, ERC-20 token metadata and a universal search across addresses, tokens, blocks and transactions. Real data, no key.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/unichain-api/..."
```

## Pricing
- **Free** (Free) — 1,000 calls/Mo, 1 req/s
- **Basic** ($13/Mo) — 60,000 calls/Mo, 10 req/s
- **Pro** ($42/Mo) — 400,000 calls/Mo, 20 req/s
- **Mega** ($139/Mo) — 2,000,000 calls/Mo, 50 req/s

## Endpoints

### Network

#### `GET /v1/gas` — Current gas prices

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unichain-api/v1/gas"
```

**Response:**
```json
{
    "data": {
        "fast": 0.01,
        "slow": 0.01,
        "unit": "gwei",
        "average": 0.01,
        "gas_used_today": "80101212877"
    },
    "meta": {
        "timestamp": "2026-06-08T01:18:18.073Z",
        "request_id": "84eece72-f3b7-455d-8b52-373676b005bf"
    },
    "status": "ok",
    "message": "Gas retrieved successfully",
    "success": true
}
```

#### `GET /v1/stats` — Network statistics

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unichain-api/v1/stats"
```

**Response:**
```json
{
    "data": {
        "tvl_usd": null,
        "gas_prices": {
            "fast": 0.01,
            "slow": 0.01,
            "average": 0.01
        },
        "total_blocks": 50130027,
        "coin_price_usd": 1687.87,
        "gas_used_today": "80101212877",
        "market_cap_usd": 203699776706.84998,
        "total_addresses": "13916732",
        "total_transactions": "475576643",
        "transactions_today": "894394",
        "network_utilization_percent": 2.0071915333333332
    },
    "meta": {
        "timestamp": "2026-06-08T01:18:18.201Z",
        "request_id": "82df59c1-a360-4be8-aaf6-7d7aa5008409"
    },
    "status": "ok",
    "message": "Stats retrieved successfully",
    "success": true
}
```

### Blocks

#### `GET /v1/block` — A block by height or hash

**Parameters:**
- `height` (query, optional, string) — Block height Example: `10000000`
- `hash` (query, optional, string) — Block hash

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unichain-api/v1/block?height=10000000"
```

**Response:**
```json
{
    "data": {
        "block": {
            "hash": "0x61bef46803511ef2344b14e29632af4a49e9b97aa764296ad2e2e8ab96587527",
            "size": 1998,
            "miner": "0x4200000000000000000000000000000000000011",
            "height": 10000000,
            "gas_used": 370153,
            "tx_count": 4,
            "gas_limit": 30000000,
            "timestamp": "2025-02-28T13:12:39.000000Z",
            "burnt_fees": "93278556",
            "difficulty": "0",
            "base_fee_per_gas": "252"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:18:18.309Z",
        "request_id": "8f5ec469-9104-4c5b-98a1-617435a7412c"
    },
    "status": "ok",
    "message": "Block retrieved successfully",
    "success": true
}
```

#### `GET /v1/blocks` — Latest blocks

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unichain-api/v1/blocks"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "blocks": [
            {
                "hash": "0x68026807e2f7dd5f402132e79f14e392c422111f482ae3a54511572c3bb705f5",
                "size": 5537,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 50133139,
                "gas_used": 998524,
                "tx_count": 14,
                "gas_limit": 60000000,
                "timestamp": "2026-06-08T01:18:18.000000Z",
                "burnt_fees": "499262000000",
                "difficulty": "0",
                "base_fee_per_gas": "500000"
            },
            {
                "hash": "0x5e8bf1a45a7c7749f4575e3b409e74756ab5e2651e2de1a7eaf8f9b393b60ef3",
                "size": 6002,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 50133138,
                "gas_used": 990980,
                "tx_count": 15,
                "gas_limit": 60000000,
                "timestamp": "2026-06-08T01:18:17.000000Z",
                "burnt_fees": "495490000000",
                "difficulty": "0",
                "base_fee_per_gas": "500000"
            },
            {
                "hash": "0xf62d9e26059bee812e3c72064f9b94220728b99e3e6a8e7c07f1940b6e4afe76",
                "size": 2977,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 50133137,
                "gas_used": 612520,
                "tx_count": 8,
                "gas_limi
…(truncated, see openapi.json for full schema)
```

### Accounts

#### `GET /v1/address` — Address detail with ETH balance

**Parameters:**
- `address` (query, required, string) — Address hash Example: `0x078D782b760474a361dDA0AF3839290b0EF57AD6`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unichain-api/v1/address?address=0x078D782b760474a361dDA0AF3839290b0EF57AD6"
```

**Response:**
```json
{
    "data": {
        "address": {
            "ens": null,
            "hash": "0x078D782b760474a361dDA0AF3839290b0EF57AD6",
            "name": "USDC",
            "token": {
                "name": "USDC",
                "type": "ERC-20",
                "symbol": "USDC"
            },
            "creator": "0xD1dE07e817F22104339711056911502D444F8424",
            "balance_eth": 0,
            "balance_wei": "0",
            "is_contract": true,
            "is_verified": true
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:18:19.261Z",
        "request_id": "f2b2f0e1-69bd-49a4-b09b-b0037f2a898c"
    },
    "status": "ok",
    "message": "Address retrieved successfully",
    "success": true
}
```

### Transactions

#### `GET /v1/transaction` — A transaction by hash

**Parameters:**
- `hash` (query, required, string) — Transaction hash Example: `0xd68d4f0d4f9f9fd25c2940f479a7105533fbbc4e5fee5a87d9f7c80cd1dd52a2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unichain-api/v1/transaction?hash=0xd68d4f0d4f9f9fd25c2940f479a7105533fbbc4e5fee5a87d9f7c80cd1dd52a2"
```

**Response:**
```json
{
    "data": {
        "transaction": {
            "to": "0x4200000000000000000000000000000000000015",
            "from": "0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001",
            "hash": "0xd68d4f0d4f9f9fd25c2940f479a7105533fbbc4e5fee5a87d9f7c80cd1dd52a2",
            "type": 126,
            "block": 10000000,
            "nonce": 9999999,
            "method": "setL1BlockValuesEcotone",
            "status": "ok",
            "fee_eth": 0,
            "fee_wei": "0",
            "gas_used": 55102,
            "gas_price": "0",
            "timestamp": "2025-02-28T13:12:39.000000Z",
            "value_eth": 0,
            "value_wei": "0",
            "confirmations": 40133141
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:18:19.899Z",
        "request_id": "34073619-83e6-4428-9170-114105d02247"
    },
    "status": "ok",
    "message": "Transaction retrieved successfully",
    "success": true
}
```

### Tokens

#### `GET /v1/token` — ERC-20 token metadata

**Parameters:**
- `address` (query, required, string) — Token contract address Example: `0x078D782b760474a361dDA0AF3839290b0EF57AD6`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unichain-api/v1/token?address=0x078D782b760474a361dDA0AF3839290b0EF57AD6"
```

**Response:**
```json
{
    "data": {
        "token": {
            "icon": "https://assets.coingecko.com/coins/images/6319/small/USDC.png?1769615602",
            "name": "USDC",
            "type": "ERC-20",
            "symbol": "USDC",
            "holders": null,
            "decimals": 6,
            "total_supply": "35856976024425",
            "exchange_rate_usd": 0.999783,
            "circulating_market_cap": "75661361901.08565"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:18:20.037Z",
        "request_id": "df54700d-04f2-497c-b429-6462769c7784"
    },
    "status": "ok",
    "message": "Token retrieved successfully",
    "success": true
}
```

### Search

#### `GET /v1/search` — Universal on-chain search

**Parameters:**
- `q` (query, required, string) — Address, token, block or tx Example: `USDC`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unichain-api/v1/search?q=USDC"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "query": "USDC",
        "results": [
            {
                "name": "USDC",
                "type": "token",
                "symbol": "USDC",
                "address": "0x078D782b760474a361dDA0AF3839290b0EF57AD6"
            },
            {
                "name": "Spark USDC Vault",
                "type": "token",
                "symbol": "sUSDC",
                "address": "0x14d9143BEcC348920b68D123687045db49a016C6"
            },
            {
                "name": "Venus USDC (Core)",
                "type": "token",
                "symbol": "vUSDC_Core",
                "address": "0xB953f92B9f759d97d2F2Dec10A8A3cf75fcE3A95"
            },
            {
                "name": "USD Coin",
                "type": "token",
                "symbol": "USDC",
                "address": "0xB3FCA863dD0F6b496cCDDf6497Da5Dad67857F56"
            },
            {
                "name": "Compound USDC",
                "type": "token",
                "symbol": "cUSDCv3",
                "address": "0x2c7118c4C88B9841FCF839074c26Ae8f035f2921"
            },
            {
                "name": "Gauntlet USDC",
                "type": "token",
                "symbol": "gtusdcc",
                "address": "0x38f4f3B6533de0023b9DCd04b02F93d36ad1F9f9"
            },
            {
                "name": "POPT-V1 WETH LP on USDC/WETH 5bps",
                "type": "token",
                "symbol": "poWETH",
             
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unichain-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "service": "unichain-api",
        "endpoints": {
            "GET /v1/gas": "Gas oracle (slow/average/fast in gwei).",
            "GET /v1/meta": "This document.",
            "GET /v1/block": "Block detail by height= or hash=.",
            "GET /v1/stats": "Network stats (blocks, txns, coin price, market cap, gas).",
            "GET /v1/token": "ERC-20 token detail by contract (address=).",
            "GET /v1/blocks": "The most recent blocks.",
            "GET /v1/search": "Search addresses, tokens, blocks & txns (q=).",
            "GET /v1/address": "Address balance, ENS & contract info (address=).",
            "GET /v1/transaction": "Transaction detail (hash=)."
        },
        "description": "Live Unichain (L2) on-chain data via Blockscout: network stats, a gas oracle (gwei), recent blocks and block detail, address balances with ENS, transaction detail, ERC-20 token detail and a universal search across addresses, tokens, blocks and transactions. Unichain is Uniswap's Ethereum L2; gas and balances are in ETH. Real on-chain data, no key."
    },
    "meta": {
        "timestamp": "2026-06-08T01:18:20.780Z",
        "request_id": "452c16fd-d9bb-4703-a40a-fbb75db9cad1"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/unichain-api
OpenAPI spec: https://www.oanor.com/api/unichain-api/openapi.json
