# Derive Chain API
> Live on-chain data for Derive mainnet (the DeFi options/perps Ethereum L2 formerly known as Lyra, 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, DeFi dashboards, portfolio trackers and on-chain monitoring on Derive.

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

## Pricing
- **Free** (Free) — 4,700 calls/Mo, 2 req/s
- **Basic** ($9/Mo) — 116,000 calls/Mo, 8 req/s
- **Pro** ($28/Mo) — 630,000 calls/Mo, 20 req/s
- **Mega** ($77/Mo) — 3,250,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/derive-api/v1/gas"
```

**Response:**
```json
{
    "data": {
        "fast": 0.01,
        "slow": 0.01,
        "unit": "gwei",
        "average": 0.01,
        "gas_used_today": "65705216079"
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:03.927Z",
        "request_id": "9a788998-2475-4094-8b42-0fddbbe627cf"
    },
    "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/derive-api/v1/stats"
```

**Response:**
```json
{
    "data": {
        "tvl_usd": null,
        "gas_prices": {
            "fast": 0.01,
            "slow": 0.01,
            "average": 0.01
        },
        "total_blocks": 40460366,
        "coin_price_usd": null,
        "gas_used_today": "65705216079",
        "market_cap_usd": 0,
        "total_addresses": "63154",
        "total_transactions": "52026955",
        "transactions_today": "72771",
        "network_utilization_percent": 0.096358984
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:04.206Z",
        "request_id": "995c132e-4785-4deb-84a3-29ec602aa5f2"
    },
    "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: `40448000`
- `hash` (query, optional, string) — Block hash (0x + 64 hex)

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

**Response:**
```json
{
    "data": {
        "block": {
            "hash": "0x83895baa13ce03901fd2f0fe2d57888858170c9347e658cfc3522d6c09dd0a5e",
            "size": 4107,
            "miner": "0x4200000000000000000000000000000000000011",
            "height": 40448000,
            "gas_used": 235703,
            "tx_count": 2,
            "gas_limit": 500000000,
            "timestamp": "2026-06-08T11:20:15.000000Z",
            "burnt_fees": "58925750",
            "difficulty": "0",
            "base_fee_per_gas": "250"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:04.497Z",
        "request_id": "546f43ae-b3cf-4be9-8ec6-4f6ada6eb044"
    },
    "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/derive-api/v1/blocks"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "blocks": [
            {
                "hash": "0xa75ab7b7744dd369f29c978e9cfc57f81daec1d877a5e2907b9439cab07036b3",
                "size": 907,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 40460774,
                "gas_used": 57382,
                "tx_count": 1,
                "gas_limit": 500000000,
                "timestamp": "2026-06-08T18:26:03.000000Z",
                "burnt_fees": "14345500",
                "difficulty": "0",
                "base_fee_per_gas": "250"
            },
            {
                "hash": "0x318a7a4922a93e3ec74c33ce112498ad4629f1d56a84ceacd3fc0c475326821b",
                "size": 907,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 40460773,
                "gas_used": 46194,
                "tx_count": 1,
                "gas_limit": 500000000,
                "timestamp": "2026-06-08T18:26:01.000000Z",
                "burnt_fees": "11548500",
                "difficulty": "0",
                "base_fee_per_gas": "250"
            },
            {
                "hash": "0x63fd326f4e33ddd665d46dac5b0712f932196e06d34b0148e95d25ca4bc28d68",
                "size": 907,
                "miner": "0x4200000000000000000000000000000000000011",
                "height": 40460772,
                "gas_used": 46194,
                "tx_count": 1,
                "gas_limit": 500000000,
     
…(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: `0xd991fC1368580C5917153916a73D3b3C2A8e65bD`

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

**Response:**
```json
{
    "data": {
        "address": {
            "ens": null,
            "hash": "0xd991fC1368580C5917153916a73D3b3C2A8e65bD",
            "name": null,
            "token": null,
            "creator": null,
            "balance_eth": 1.1716592587641592,
            "balance_wei": "1171659258764159129",
            "is_contract": false,
            "is_verified": false
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:05.705Z",
        "request_id": "fe3aacd6-186c-4505-af6f-297558d6a62d"
    },
    "status": "ok",
    "message": "Address retrieved successfully",
    "success": true
}
```

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

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

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

**Response:**
```json
{
    "data": {
        "transaction": {
            "to": "0xd8d46a044f62d97733707176D6791b0a73cd7f6C",
            "from": "0xd991fC1368580C5917153916a73D3b3C2A8e65bD",
            "hash": "0x157a06339d9b4e8d8f443b29025c42c3bf85f7d8d570de036a8967edcca2f59f",
            "type": 2,
            "block": 40448903,
            "nonce": 3304897,
            "method": "submitData",
            "status": "ok",
            "fee_eth": 8.959294283e-8,
            "fee_wei": "89592942830",
            "gas_used": 177565,
            "gas_price": "100250",
            "timestamp": "2026-06-08T11:50:21.000000Z",
            "value_eth": 0,
            "value_wei": "0",
            "confirmations": 11873
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:06.090Z",
        "request_id": "f9dec3fb-5ff9-40b8-b9a0-422e81e78a52"
    },
    "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: `0x15CEcd5190A43C7798dD2058308781D0662e678E`

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

**Response:**
```json
{
    "data": {
        "token": {
            "icon": null,
            "name": "Lyra WETH",
            "type": "ERC-20",
            "symbol": "WETH",
            "address": "0x15CEcd5190A43C7798dD2058308781D0662e678E",
            "holders": 8133,
            "decimals": 18,
            "total_supply": "2695235928846426671686",
            "exchange_rate_usd": null,
            "circulating_market_cap": null
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:06.398Z",
        "request_id": "8af620db-f743-41dd-aeec-fa459ca31cc4"
    },
    "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: `derive`

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

**Response:**
```json
{
    "data": {
        "count": 8,
        "query": "derive",
        "results": [
            {
                "name": "Staked Derive",
                "type": "token",
                "symbol": "stDRV",
                "address": "0x7499d654422023a407d92e1D83D387d81BC68De1"
            },
            {
                "name": "Derive",
                "type": "token",
                "symbol": "DRV",
                "address": "0x2EE0fd70756EDC663AcC9676658A1497C247693A"
            },
            {
                "name": "Trading Strategy Derive test Lagoon vault 2",
                "type": "token",
                "symbol": "TSDERIVE2",
                "address": "0xE9D4597D6d3f4B781553013FEADff7584E9C7B92"
            },
            {
                "name": "DeriveL2",
                "type": "contract",
                "address": "0x340B51Cb46DBF63B55deD80a78a40aa75Dd4ceDF"
            },
            {
                "name": "DeriveOFTReceiver",
                "type": "contract",
                "address": "0x6C33F39D0CcaA850b2B4862991e8DDF3B59b1647"
            },
            {
                "name": "DeriveOFTReceiver",
                "type": "contract",
                "address": "0x66fa8499f57FcCEC9805a4e5D6308Ea011029054"
            },
            {
                "name": "DeriveSettlementUtilsNew",
                "type": "contract",
                "address": "0x3357f0AA308683ed506fE111e26d31DB64d6EabA"
            },
            {
                "name
…(truncated, see openapi.json for full schema)
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "service": "derive-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 Derive (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:06.844Z",
        "request_id": "c373e276-2033-4525-a053-3ed209367fdc"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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