# Elastos Chain API
> Live on-chain data for Elastos Smart Chain (ESC) — an EVM sidechain merge-mined with Bitcoin — via its public Blockscout explorer (no wallet, no key). The stats endpoint returns chain-wide totals (blocks, transactions, addresses, average block time, gas used); gas gives the current gas-price oracle (slow/average/fast). Blocks lists the latest blocks, and a single block resolves by height or by hash with its transaction count, gas, miner and timestamp. The address endpoint returns any account's ELA balance, nonce, contract flag and token holdings; transaction resolves a tx by hash with its from/to, value in ELA, fee, status and block. The token endpoint returns an ERC-20 token's metadata (name, symbol, decimals, total supply, holders) by contract address, and search runs a universal lookup across addresses, tokens, blocks and transactions. Gas, balances, values and fees are denominated in ELA, the native coin. Real on-chain data straight from the explorer, refreshed every call — no key. 9 endpoints. For multi-chain coverage combine with the other oanor chain APIs (Ethereum, Base, Arbitrum and more).

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

## Pricing
- **Free** (Free) — 4,600 calls/Mo, 2 req/s
- **Basic** ($29/Mo) — 136,000 calls/Mo, 8 req/s
- **Pro** ($88/Mo) — 785,000 calls/Mo, 20 req/s
- **Mega** ($295/Mo) — 4,450,000 calls/Mo, 50 req/s

## Endpoints

### Chain

#### `GET /v1/gas` — Gas-price oracle

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

**Response:**
```json
{
    "data": {
        "fast": 25,
        "slow": 25,
        "unit": "gwei",
        "average": 25,
        "gas_used_today": "73952616"
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:10.913Z",
        "request_id": "6bea33a6-ac61-4c8c-a5b9-faf908d01edc"
    },
    "status": "ok",
    "message": "Gas retrieved successfully",
    "success": true
}
```

#### `GET /v1/stats` — Chain stats

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

**Response:**
```json
{
    "data": {
        "tvl_usd": null,
        "gas_prices": {
            "fast": 25,
            "slow": 25,
            "average": 25
        },
        "total_blocks": 37060433,
        "coin_price_usd": 0.3490363022148258,
        "gas_used_today": "73952616",
        "market_cap_usd": 8064349.732733499,
        "total_addresses": "91634",
        "total_transactions": "6112422",
        "transactions_today": "639",
        "network_utilization_percent": 0.10915475
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:11.223Z",
        "request_id": "68cb044d-f290-42ca-9036-bcf537bb6aa5"
    },
    "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: `37059142`
- `hash` (query, optional, string) — Block hash (alternative to height)

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

**Response:**
```json
{
    "data": {
        "block": {
            "hash": "0x74a43fceeae5ddcad8cad524cf2a569c53b45ba9993548d3138694759af67d5d",
            "size": 2539,
            "miner": "0x0170F9880cA46C41ff9eB6462f6758b65Bc3cD47",
            "height": 37059142,
            "gas_used": 144031,
            "tx_count": 1,
            "gas_limit": 8000000,
            "timestamp": "2026-06-08T06:32:10.000000Z",
            "burnt_fees": "0",
            "difficulty": "2",
            "base_fee_per_gas": null
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:11.531Z",
        "request_id": "791c2109-f62f-4f21-a082-64e79cc553e9"
    },
    "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/elastos-api/v1/blocks"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "blocks": [
            {
                "hash": "0xef3b072245e12d94af975ee9471e6381a79e07ce27934f759c352c6418e847a8",
                "size": 1845,
                "miner": "0x0170F9880cA46C41ff9eB6462f6758b65Bc3cD47",
                "height": 37061309,
                "gas_used": 0,
                "tx_count": 0,
                "gas_limit": 8000000,
                "timestamp": "2026-06-08T09:49:10.000000Z",
                "burnt_fees": "0",
                "difficulty": "2",
                "base_fee_per_gas": null
            },
            {
                "hash": "0x2c0c253c04748a39efd6cfbbf3d7b26ded40b517e68cd5758ed642cf041e0eda",
                "size": 1845,
                "miner": "0x7E319618d07F9Be1EcF7311FC6CA4F9F9Db23D85",
                "height": 37061308,
                "gas_used": 0,
                "tx_count": 0,
                "gas_limit": 8000000,
                "timestamp": "2026-06-08T09:49:05.000000Z",
                "burnt_fees": "0",
                "difficulty": "2",
                "base_fee_per_gas": null
            },
            {
                "hash": "0x586cc33ea9e7fb5e7a27b5b83d5ee9414a97bb54fe600ba0e44725afa1c4b857",
                "size": 1845,
                "miner": "0x7E319618d07F9Be1EcF7311FC6CA4F9F9Db23D85",
                "height": 37061307,
                "gas_used": 0,
                "tx_count": 0,
                "gas_limit": 8000000,
                "timestamp": "2026-0
…(truncated, see openapi.json for full schema)
```

### Accounts

#### `GET /v1/address` — Account balance & holdings

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

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

**Response:**
```json
{
    "data": {
        "address": {
            "ens": null,
            "hash": "0xE241cc9d0c8ed86f64c9d98b55CC66aFda6eB50c",
            "name": null,
            "token": null,
            "creator": null,
            "balance_ela": 20.70325338462483,
            "balance_wei": "20703253384624830364",
            "is_contract": false,
            "is_verified": false
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:12.495Z",
        "request_id": "4a7324bb-4737-4edf-8e16-10fffa0c47e6"
    },
    "status": "ok",
    "message": "Address retrieved successfully",
    "success": true
}
```

### Transactions

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

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

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

**Response:**
```json
{
    "data": {
        "transaction": {
            "to": "0x5117b046517ffA18d4d9897090D0537fF62A844A",
            "from": "0xE241cc9d0c8ed86f64c9d98b55CC66aFda6eB50c",
            "hash": "0x3ce413674e8619c53a9f08e5f0cc9ec23bb6a4177bbce376d3f9d9161f01d2cd",
            "type": null,
            "block": 37059142,
            "nonce": 546812,
            "method": "0x24e48a2d",
            "status": "ok",
            "fee_ela": 0.003600775,
            "fee_wei": "3600775000000000",
            "gas_used": 144031,
            "gas_price": "25000000000",
            "timestamp": "2026-06-08T06:32:10.000000Z",
            "value_ela": 0,
            "value_wei": "0",
            "confirmations": 2168
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:15.914Z",
        "request_id": "a0d101b4-b422-4ebf-ba08-3d2ff5d0f9e4"
    },
    "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: `0xeEeEEb57642040bE42185f49C52F7E9B38f8eeeE`

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

**Response:**
```json
{
    "data": {
        "token": {
            "icon": null,
            "name": "Elk",
            "type": "ERC-20",
            "symbol": "ELK",
            "address": "0xeEeEEb57642040bE42185f49C52F7E9B38f8eeeE",
            "holders": 177,
            "decimals": 18,
            "total_supply": "42424242000000000000000000",
            "exchange_rate_usd": 0.03465159,
            "circulating_market_cap": "559492.1765562827"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:16.218Z",
        "request_id": "d834df3b-f272-43fc-82e5-52607d482930"
    },
    "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: `ELK`

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

**Response:**
```json
{
    "data": {
        "count": 50,
        "query": "ELK",
        "results": [
            {
                "name": "Elk",
                "type": "token",
                "symbol": "ELK",
                "address": "0xeEeEEb57642040bE42185f49C52F7E9B38f8eeeE"
            },
            {
                "name": "Elk",
                "type": "token",
                "symbol": "ELK",
                "address": "0xE1C110E1B1b4A1deD0cAf3E42BfBdbB7b5d7cE1C"
            },
            {
                "name": "Elk Liquidity",
                "type": "token",
                "symbol": "ELP",
                "address": "0x9d5641fc60FA00aF9406528d1f41F45c86BaBB72"
            },
            {
                "name": "Elk Liquidity",
                "type": "token",
                "symbol": "ELP",
                "address": "0x8d78C926E50357fF447494fE090818F16Caf8C30"
            },
            {
                "name": "Elk Liquidity",
                "type": "token",
                "symbol": "ELP",
                "address": "0x21427f4B29f0560ce0F3d9849a768bf2243707Af"
            },
            {
                "name": "Elk Liquidity",
                "type": "token",
                "symbol": "ELP",
                "address": "0x070826166BF3DB6d18930FEF4f28e7133C3286E4"
            },
            {
                "name": "Elk Liquidity",
                "type": "token",
                "symbol": "ELP",
                "address": "0x680573a8F07cFa3a84519D0136DDd161667011A
…(truncated, see openapi.json for full schema)
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "service": "elastos-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 Elastos Smart Chain 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. Elastos Smart Chain (ESC) is an EVM sidechain merge-mined with Bitcoin; gas, balances and fees are in ELA. Real on-chain data, no key."
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:16.968Z",
        "request_id": "a436c32f-9042-4656-8012-dfeb5f600dbb"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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