# Mode Chain API
> Live on-chain data for Mode mainnet (an Optimism-stack Ethereum L2, native ETH) via Blockscout — no key. Read network stats (block height, total transactions, gas), a gas oracle in gwei, the most recent blocks and full block detail by height or hash, any address balance and contract info, full transaction detail, ERC-20 token detail by contract, and a universal search across addresses, tokens, blocks and transactions. Real Layer-2 chain data with the rotating proxy as automatic fallback — 9 endpoints. Ideal for wallets, explorers, portfolio trackers, analytics dashboards and on-chain monitoring on Mode.

## 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/mode-api/..."
```

## Pricing
- **Free** (Free) — 5,000 calls/Mo, 2 req/s
- **Basic** ($9/Mo) — 118,000 calls/Mo, 8 req/s
- **Pro** ($28/Mo) — 640,000 calls/Mo, 20 req/s
- **Mega** ($76/Mo) — 3,300,000 calls/Mo, 50 req/s

## Endpoints

### Network

#### `GET /v1/gas` — Gas oracle (gwei)

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

**Response:**
```json
{
    "data": {
        "fast": 0.01,
        "slow": 0.01,
        "unit": "gwei",
        "average": 0.01,
        "gas_used_today": "29312860413"
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:26.330Z",
        "request_id": "acd99cd8-972c-4727-b58d-f342cc1a9f6b"
    },
    "status": "ok",
    "message": "Gas retrieved successfully",
    "success": true
}
```

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

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

**Response:**
```json
{
    "data": {
        "tvl_usd": null,
        "gas_prices": {
            "fast": 0.01,
            "slow": 0.01,
            "average": 0.01
        },
        "total_blocks": 40387605,
        "coin_price_usd": 1685.66,
        "gas_used_today": "29312860413",
        "market_cap_usd": 203433019091.30765,
        "total_addresses": "1798533",
        "total_transactions": "141867169",
        "transactions_today": "91756",
        "network_utilization_percent": 2.0292362666666666
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:26.500Z",
        "request_id": "b636e550-179d-4326-81bf-cd4622812c28"
    },
    "status": "ok",
    "message": "Stats retrieved successfully",
    "success": true
}
```

### Blocks

#### `GET /v1/block` — Block detail by height or hash

**Parameters:**
- `height` (query, optional, string) — Block height Example: `40374000`
- `hash` (query, optional, string) — Block hash (0x + 64 hex)

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

**Response:**
```json
{
    "data": {
        "block": {
            "hash": "0x358395395815a917e093a3682dedd452b99d23fe35eb72063df8a3205bcab26e",
            "size": 1027,
            "miner": "0x4200000000000000000000000000000000000011",
            "height": 40374000,
            "gas_used": 607094,
            "tx_count": 2,
            "gas_limit": 30000000,
            "timestamp": "2026-06-08T10:46:23.000000Z",
            "burnt_fees": "152987688",
            "difficulty": "0",
            "base_fee_per_gas": "252"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:26.682Z",
        "request_id": "3bd67664-b9a7-4ccb-8ae1-e4a892d054c8"
    },
    "status": "ok",
    "message": "Block retrieved successfully",
    "success": true
}
```

#### `GET /v1/blocks` — Most recent blocks

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

**Response:**
```json
{
    "data": {
        "count": 50,
        "blocks": [
            {
                "hash": "0xa56d4cfbddb803e4a511f796d29dd0839c7b428cffde1ad95201278c7deecd2a",
                "size": 1027,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 40387801,
                "gas_used": 607082,
                "tx_count": 2,
                "gas_limit": 30000000,
                "timestamp": "2026-06-08T18:26:25.000000Z",
                "burnt_fees": "152984664",
                "difficulty": "0",
                "base_fee_per_gas": "252"
            },
            {
                "hash": "0x6a1eb4d4da0ac89a4492daab58bddc463e97f1f684c9f40fbd6e1f87d815d4c7",
                "size": 1027,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 40387800,
                "gas_used": 607082,
                "tx_count": 2,
                "gas_limit": 30000000,
                "timestamp": "2026-06-08T18:26:23.000000Z",
                "burnt_fees": "152984664",
                "difficulty": "0",
                "base_fee_per_gas": "252"
            },
            {
                "hash": "0x7766273b53c11becb3bc09fd8f3613240f53282f7b2fdbaf246bcd015fc0910b",
                "size": 1027,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 40387799,
                "gas_used": 607082,
                "tx_count": 2,
                "gas_limit": 30000000,

…(truncated, see openapi.json for full schema)
```

### Accounts

#### `GET /v1/address` — Address balance & contract info

**Parameters:**
- `address` (query, required, string) — Address (0x + 40 hex) Example: `0x559dC50164337fDEa3e7DaDfEFA6955BD3090437`

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

**Response:**
```json
{
    "data": {
        "address": {
            "ens": null,
            "hash": "0x559dC50164337fDEa3e7DaDfEFA6955BD3090437",
            "name": null,
            "token": null,
            "creator": null,
            "balance_eth": 0.05681832271663484,
            "balance_wei": "56818322716634839",
            "is_contract": false,
            "is_verified": false
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:27.777Z",
        "request_id": "ff78caa2-2f18-484a-a271-2b1712b57472"
    },
    "status": "ok",
    "message": "Address retrieved successfully",
    "success": true
}
```

#### `GET /v1/transaction` — Transaction detail

**Parameters:**
- `hash` (query, required, string) — Transaction hash (0x + 64 hex) Example: `0x191d5e838c4bf68f97007d520df40af3738bb4b0c6586e62ac18971faac5a49d`

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

**Response:**
```json
{
    "data": {
        "transaction": {
            "to": "0x536688ef204Ba2B035f77Be1bF4B1A0dd675B266",
            "from": "0x559dC50164337fDEa3e7DaDfEFA6955BD3090437",
            "hash": "0x191d5e838c4bf68f97007d520df40af3738bb4b0c6586e62ac18971faac5a49d",
            "type": 2,
            "block": 40374606,
            "nonce": 16422821,
            "method": "swap_6269342730",
            "status": "ok",
            "fee_eth": 2.3839240109e-8,
            "fee_wei": "23839240109",
            "gas_used": 560852,
            "gas_price": "272",
            "timestamp": "2026-06-08T11:06:35.000000Z",
            "value_eth": 0,
            "value_wei": "0",
            "confirmations": 13196
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:29.793Z",
        "request_id": "9c1361f0-b6fe-4704-8149-41696d1a2cf3"
    },
    "status": "ok",
    "message": "Transaction retrieved successfully",
    "success": true
}
```

### Tokens

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

**Parameters:**
- `address` (query, required, string) — Token contract (0x + 40 hex) Example: `0xDfc7C877a950e49D2610114102175A06C2e3167a`

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

**Response:**
```json
{
    "data": {
        "token": {
            "icon": "https://assets.coingecko.com/coins/images/34979/small/MODE.jpg?1714561871",
            "name": "Mode",
            "type": "ERC-20",
            "symbol": "MODE",
            "address": "0xDfc7C877a950e49D2610114102175A06C2e3167a",
            "holders": 105703,
            "decimals": 18,
            "total_supply": "10000000000000000000000000000",
            "exchange_rate_usd": null,
            "circulating_market_cap": null
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:29.948Z",
        "request_id": "1c413af9-0659-44e7-8c72-8e98a6a8b3b1"
    },
    "status": "ok",
    "message": "Token retrieved successfully",
    "success": true
}
```

### Search

#### `GET /v1/search` — Universal search

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

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

**Response:**
```json
{
    "data": {
        "count": 50,
        "query": "mode",
        "results": [
            {
                "name": "Mode",
                "type": "token",
                "symbol": "MODE",
                "address": "0xDfc7C877a950e49D2610114102175A06C2e3167a"
            },
            {
                "name": "Mode Bridged USDC (Mode)",
                "type": "token",
                "symbol": "USDC",
                "address": "0xd988097fb8612cc24eeC14542bC03424c656005f"
            },
            {
                "name": "Mode Bridged USDT (Mode)",
                "type": "token",
                "symbol": "USDT",
                "address": "0xf0F161fDA2712DB8b566946122a5af183995e2eD"
            },
            {
                "name": "L2 Standard Bridged WETH (Mode)",
                "type": "token",
                "symbol": "WETH",
                "address": "0x4200000000000000000000000000000000000006"
            },
            {
                "name": "Mode Bridged WBTC (Mode)",
                "type": "token",
                "symbol": "WBTC",
                "address": "0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF"
            },
            {
                "name": "MODE",
                "type": "token",
                "symbol": "Claim on: airdrop.mode-claim.com",
                "address": "0x27e473a5Ce78154b1d2c56D9Dda3FB45b2107a22"
            },
            {
                "name": "SPACE ID Name Service",
                "type": "token",
      
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Spec

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

**Response:**
```json
{
    "data": {
        "service": "mode-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 & contract info (address=).",
            "GET /v1/transaction": "Transaction detail (hash=)."
        },
        "description": "Live Mode (ETH) L2 on-chain data via Blockscout: network stats, a gas oracle (gwei), recent blocks and block detail, address balances, transaction detail, ERC-20 token detail and a universal search across addresses, tokens, blocks and transactions. Real on-chain data, no key."
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:33.684Z",
        "request_id": "c6ed2534-8d48-4735-a3b4-5c4328f5394a"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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