# Swellchain API
> Live Swellchain on-chain data via Blockscout. Swellchain is a restaking-powered 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/swell-api/..."
```

## Pricing
- **Free** (Free) — 1,600 calls/Mo, 1 req/s
- **Basic** ($11/Mo) — 82,000 calls/Mo, 10 req/s
- **Pro** ($36/Mo) — 540,000 calls/Mo, 20 req/s
- **Mega** ($118/Mo) — 2,400,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/swell-api/v1/gas"
```

**Response:**
```json
{
    "data": {
        "fast": 0.01,
        "slow": 0.01,
        "unit": "gwei",
        "average": 0.01,
        "gas_used_today": "37949957900"
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:41.592Z",
        "request_id": "e93989da-41c2-4a7a-8343-7f0850ed76f1"
    },
    "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/swell-api/v1/stats"
```

**Response:**
```json
{
    "data": {
        "tvl_usd": null,
        "gas_prices": {
            "fast": 0.01,
            "slow": 0.01,
            "average": 0.01
        },
        "total_blocks": 24106664,
        "coin_price_usd": null,
        "gas_used_today": "37949957900",
        "market_cap_usd": 0,
        "total_addresses": "203302",
        "total_transactions": "49413049",
        "transactions_today": "81519",
        "network_utilization_percent": 1.4958903666666667
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:42.400Z",
        "request_id": "46c68661-5798-49c0-939d-1eaf3a57df4d"
    },
    "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: `24092728`
- `hash` (query, optional, string) — Block hash

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

**Response:**
```json
{
    "data": {
        "block": {
            "hash": "0xea520ebb01fe798898512cc4918280bf3c3b77e5cf7732dda1aa99ef42ce413d",
            "size": 1021,
            "miner": "0x4200000000000000000000000000000000000011",
            "height": 24092728,
            "gas_used": 1298629,
            "tx_count": 2,
            "gas_limit": 60000000,
            "timestamp": "2026-06-08T01:29:19.000000Z",
            "burnt_fees": "325955879",
            "difficulty": "0",
            "base_fee_per_gas": "251"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:43.193Z",
        "request_id": "adb71e9c-f1d8-443b-9bf8-d80f87490c76"
    },
    "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/swell-api/v1/blocks"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "blocks": [
            {
                "hash": "0xe3d81e2e52ce1dbec25e6c53ac11b59fb370a2b34d398c3a799fe73d3dcf2631",
                "size": 1021,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 24107797,
                "gas_used": 613284,
                "tx_count": 2,
                "gas_limit": 60000000,
                "timestamp": "2026-06-08T09:51:37.000000Z",
                "burnt_fees": "153934284",
                "difficulty": "0",
                "base_fee_per_gas": "251"
            },
            {
                "hash": "0xab1727016e6e72d83771de4426629126b44aed672efe0c8b594c16935e4b5735",
                "size": 1021,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 24107796,
                "gas_used": 1309805,
                "tx_count": 2,
                "gas_limit": 60000000,
                "timestamp": "2026-06-08T09:51:35.000000Z",
                "burnt_fees": "328761055",
                "difficulty": "0",
                "base_fee_per_gas": "251"
            },
            {
                "hash": "0x4f2d2410083c10b763314f1374ac1c3dadf76708684398e093648248406391e0",
                "size": 907,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 24107795,
                "gas_used": 46230,
                "tx_count": 1,
                "gas_limit": 60000000,
 
…(truncated, see openapi.json for full schema)
```

### Accounts

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

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

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

**Response:**
```json
{
    "data": {
        "address": {
            "ens": null,
            "hash": "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34",
            "name": "USDeOFT",
            "token": {
                "name": "USDe",
                "type": "ERC-20",
                "symbol": "USDe"
            },
            "creator": "0xAa439FB33e55306c7c79841F20121B4c4139f3dc",
            "balance_eth": 0,
            "balance_wei": "0",
            "is_contract": true,
            "is_verified": true
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:45.919Z",
        "request_id": "abb4facc-f125-457f-9285-7d2413aff1c9"
    },
    "status": "ok",
    "message": "Address retrieved successfully",
    "success": true
}
```

### Transactions

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

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

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

**Response:**
```json
{
    "data": {
        "transaction": {
            "to": "0x4200000000000000000000000000000000000015",
            "from": "0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001",
            "hash": "0x9852a40bed7b1b9d5269497fc2229636f12fd3ab91334c54d058d7117bfbff83",
            "type": 126,
            "block": 24092728,
            "nonce": 24092729,
            "method": "0x3db6be2b",
            "status": "ok",
            "fee_eth": 0,
            "fee_wei": "0",
            "gas_used": 46230,
            "gas_price": "0",
            "timestamp": "2026-06-08T01:29:19.000000Z",
            "value_eth": 0,
            "value_wei": "0",
            "confirmations": 15073
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:46.475Z",
        "request_id": "8f500dc5-09ba-4423-9728-132599c63c6b"
    },
    "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: `0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34`

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

**Response:**
```json
{
    "data": {
        "token": {
            "icon": null,
            "name": "USDe",
            "type": "ERC-20",
            "symbol": "USDe",
            "address": "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34",
            "holders": 1928,
            "decimals": 18,
            "total_supply": "27405778720000000000000",
            "exchange_rate_usd": null,
            "circulating_market_cap": null
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:46.903Z",
        "request_id": "7dc7063f-b581-41be-b705-b4486865cc30"
    },
    "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: `USD`

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

**Response:**
```json
{
    "data": {
        "count": 30,
        "query": "USD",
        "results": [
            {
                "name": "USDe",
                "type": "token",
                "symbol": "USDe",
                "address": "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34"
            },
            {
                "name": "Relend Network USDC",
                "type": "token",
                "symbol": "rUSDC",
                "address": "0x9ab96A4668456896d45c301Bc3A15Cee76AA7B8D"
            },
            {
                "name": "Staked USDe",
                "type": "token",
                "symbol": "sUSDe",
                "address": "0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2"
            },
            {
                "name": "Stargate USD₮0 (Bridged)",
                "type": "token",
                "symbol": "USD₮0",
                "address": "0x102d758f688a4C1C5a80b116bD945d4455460282"
            },
            {
                "name": "Orki USD Stablecoin",
                "type": "token",
                "symbol": "USDK",
                "address": "0x0000bAa0b1678229863c0A941C1056b83a1955F5"
            },
            {
                "name": "USDC",
                "type": "token",
                "symbol": "USDC",
                "address": "0x99a38322cAF878Ef55AE4d0Eda535535eF8C7960"
            },
            {
                "name": "Ionic USDe",
                "type": "token",
                "symbol": "ionUSDe",
                "address": "0x80
…(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/swell-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "service": "swell-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 Swellchain (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. Swellchain is a restaking-powered Ethereum L2; gas and balances are in ETH. Real on-chain data, no key."
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:47.298Z",
        "request_id": "5de667e1-4404-4ca5-bee4-e8d01ac9f5e5"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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