# Base L2 On-Chain API
> Live Base mainnet on-chain data as an API, built on the open Blockscout explorer. Base is Coinbase's Ethereum Layer-2 (chain id 8453), where gas and balances are denominated in ETH and fees are a fraction of mainnet. Pull network stats (total blocks and transactions, ETH price, live gas), a gas oracle with slow, average and fast prices in gwei, the most recent blocks and full block detail by height or hash. Look up any address for its ETH balance and contract status, any transaction by hash for its value, fee, status, sender and receiver, and any ERC-20 token by contract for its name, symbol, decimals, holders and USD rate. Real on-chain data, no key needed upstream. Ideal for Base wallets, block explorers, gas trackers, DeFi and on-chain analytics.

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

## Pricing
- **Free** (Free) — 8,500 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 115,000 calls/Mo, 8 req/s
- **Pro** ($20/Mo) — 620,000 calls/Mo, 25 req/s
- **Mega** ($70/Mo) — 3,100,000 calls/Mo, 50 req/s

## Endpoints

### Base

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

**Parameters:**
- `address` (query, required, string) — A Base address (0x + 40 hex) Example: `0x4200000000000000000000000000000000000006`

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

**Response:**
```json
{
    "data": {
        "address": {
            "ens": null,
            "hash": "0x4200000000000000000000000000000000000006",
            "name": "L2 Standard Bridged WETH (Base)",
            "token": {
                "name": "L2 Standard Bridged WETH (Base)",
                "type": "ERC-20",
                "symbol": "WETH"
            },
            "creator": null,
            "balance_eth": 269635.3830629099,
            "balance_wei": "269635383062909866984478",
            "is_contract": true,
            "is_verified": true
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:39.958Z",
        "request_id": "fdd05d00-8e10-49c9-af37-3e9a0901ecbd"
    },
    "status": "ok",
    "message": "Address retrieved successfully",
    "success": true
}
```

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

**Parameters:**
- `height` (query, optional, string) — Block height, e.g. 10000000 Example: `10000000`
- `hash` (query, optional, string) — Block hash (alternative to height)

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

**Response:**
```json
{
    "data": {
        "block": {
            "hash": "0x53e6b5a20218a155b5758fbbe85a29bfb5be376763e6f310ba61bccf7ece1d85",
            "size": 4718,
            "miner": "0x4200000000000000000000000000000000000011",
            "height": 10000000,
            "gas_used": 979572,
            "tx_count": 11,
            "gas_limit": 30000000,
            "timestamp": "2024-02-01T12:09:07.000000Z",
            "burnt_fees": "259586580",
            "base_fee_per_gas": "265"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:40.113Z",
        "request_id": "c61be7bc-75a1-49ad-ad86-314814efb01f"
    },
    "status": "ok",
    "message": "Block retrieved successfully",
    "success": true
}
```

#### `GET /v1/blocks` — The most recent blocks

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

**Response:**
```json
{
    "data": {
        "count": 50,
        "blocks": [
            {
                "hash": "0xf4c7149bef48426beda7a3d856b229fb354678380379a4b214c4bef3701ef4d3",
                "size": 99992,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 47046109,
                "gas_used": 23181498,
                "tx_count": 134,
                "gas_limit": 400000000,
                "timestamp": "2026-06-08T01:19:25.000000Z",
                "burnt_fees": "115907490000000",
                "base_fee_per_gas": "5000000"
            },
            {
                "hash": "0x86378fd51cc6841922b43322ef1eaba27021c23e229854bfb8a72f2207a9930e",
                "size": 81195,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 47046108,
                "gas_used": 22710974,
                "tx_count": 138,
                "gas_limit": 400000000,
                "timestamp": "2026-06-08T01:19:23.000000Z",
                "burnt_fees": "113554870000000",
                "base_fee_per_gas": "5000000"
            },
            {
                "hash": "0x749c2a408a3dd3b75ddadc121296aa4a12164879364b0c3d7fe1b3b8eb921b54",
                "size": 124133,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 47046107,
                "gas_used": 35709034,
                "tx_count": 137,
                "gas_limit": 400000000,
                "timestamp": "2
…(truncated, see openapi.json for full schema)
```

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

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

**Response:**
```json
{
    "data": {
        "fast": 0.04,
        "slow": 0.01,
        "unit": "gwei",
        "average": 0.01,
        "gas_used_today": "1459503368090"
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:41.095Z",
        "request_id": "b44d4662-82fe-4f11-9da5-2f54f646f9a5"
    },
    "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/base-api/v1/stats"
```

**Response:**
```json
{
    "data": {
        "chain": "Base",
        "gas_prices": {
            "fast": 0.04,
            "slow": 0.01,
            "average": 0.01
        },
        "total_blocks": 46847305,
        "eth_price_usd": 1687.87,
        "gas_used_today": "1459503368090",
        "market_cap_usd": 203699776706.84998,
        "total_addresses": "868154166",
        "total_transactions": "6435391048",
        "transactions_today": "8567849",
        "network_utilization_percent": 10.337943745
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:41.213Z",
        "request_id": "137aef2f-8f0f-4b84-832c-83e93ab83d18"
    },
    "status": "ok",
    "message": "Stats retrieved successfully",
    "success": true
}
```

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

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

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

**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": "4321204829658779",
            "exchange_rate_usd": 0.999679,
            "circulating_market_cap": "75655389583.6811"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:41.356Z",
        "request_id": "8fdedbae-3beb-46a5-a6fe-c052b940cbb3"
    },
    "status": "ok",
    "message": "Token retrieved successfully",
    "success": true
}
```

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

**Parameters:**
- `hash` (query, required, string) — A transaction hash (0x + 64 hex) Example: `0x34c5afb9252bced761236b246f44bdfef2ee5052c1f9bfe037366421daf22914`

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

**Response:**
```json
{
    "data": {
        "transaction": {
            "to": "0x4200000000000000000000000000000000000015",
            "from": "0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001",
            "hash": "0x34c5afb9252bced761236b246f44bdfef2ee5052c1f9bfe037366421daf22914",
            "type": 126,
            "block": 10000000,
            "nonce": 9999999,
            "method": "setL1BlockValues",
            "status": "ok",
            "fee_eth": 0,
            "fee_wei": "0",
            "gas_used": 46913,
            "gas_price": "0",
            "timestamp": "2024-02-01T12:09:07.000000Z",
            "value_eth": 0,
            "value_wei": "0",
            "confirmations": 37046116
        }
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:42.240Z",
        "request_id": "9fa0a799-3c3c-493d-a0a8-b1d74919b2b3"
    },
    "status": "ok",
    "message": "Transaction retrieved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Service description & endpoints

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

**Response:**
```json
{
    "data": {
        "chain": "Base (L2, chain id 8453)",
        "service": "base-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, ETH price, gas).",
            "GET /v1/token": "ERC-20 token detail by contract (address=).",
            "GET /v1/blocks": "The most recent blocks.",
            "GET /v1/address": "Address balance & contract info (address=).",
            "GET /v1/transaction": "Transaction detail (hash=)."
        },
        "description": "Live Base (Coinbase's Ethereum L2) on-chain data via Blockscout: network stats, a gas oracle (gwei), recent blocks and block detail, address balances, transaction detail and ERC-20 token detail. Gas and balances are denominated in ETH. Real on-chain data, no key."
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:43.029Z",
        "request_id": "4ef423f8-c864-46fa-a8c9-72de83a3ca65"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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