# Astar Chain API
> Live on-chain data for Astar (ASTR) mainnet 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 EVM chain data with the rotating proxy as automatic fallback — 9 endpoints. Ideal for wallets, explorers, portfolio trackers, analytics dashboards and on-chain monitoring on Astar.

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

## Pricing
- **Free** (Free) — 5,000 calls/Mo, 2 req/s
- **Basic** ($9/Mo) — 115,000 calls/Mo, 8 req/s
- **Pro** ($27/Mo) — 620,000 calls/Mo, 20 req/s
- **Mega** ($74/Mo) — 3,100,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/astar-api/v1/gas"
```

**Response:**
```json
{
    "data": {
        "fast": 684.45,
        "slow": 684.45,
        "unit": "gwei",
        "average": 684.45,
        "gas_used_today": "579569069"
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:34.007Z",
        "request_id": "9c115e72-2dae-46a9-9887-86fbe0511cfe"
    },
    "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/astar-api/v1/stats"
```

**Response:**
```json
{
    "data": {
        "tvl_usd": null,
        "gas_prices": {
            "fast": 684.45,
            "slow": 684.45,
            "average": 684.45
        },
        "total_blocks": 13619450,
        "coin_price_usd": null,
        "gas_used_today": "579569069",
        "market_cap_usd": 0,
        "total_addresses": "5226811",
        "total_transactions": "82536998",
        "transactions_today": "4850",
        "network_utilization_percent": 0.048192733333333335
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:34.528Z",
        "request_id": "b7b2e710-50b5-4a53-a3e3-f109f6493a5e"
    },
    "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: `13616000`
- `hash` (query, optional, string) — Block hash (0x + 64 hex)

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

**Response:**
```json
{
    "data": {
        "block": {
            "hash": "0x8825affeed06cba0cc21a5f0260e6e3b8c995d756692f2a877ee4df7823fa1a5",
            "size": 514,
            "miner": "0x53323e96751230F4E6cA683307B06223844B23d9",
            "height": 13616000,
            "gas_used": 0,
            "tx_count": 0,
            "gas_limit": 60000000,
            "timestamp": "2026-06-08T09:34:06.000000Z",
            "burnt_fees": "0",
            "difficulty": "0",
            "base_fee_per_gas": "779371350051"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:34.662Z",
        "request_id": "7b355241-db7c-46e3-8d69-0663517ec19f"
    },
    "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/astar-api/v1/blocks"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "blocks": [
            {
                "hash": "0xe6ad77e0dc3f1cd826e6ebdea11fd75254f057e7ff4f2ac0cea986151d055d99",
                "size": 514,
                "miner": "0xbECb591A0953818817BF2bD5ae35377692DCbf32",
                "height": 13620266,
                "gas_used": 0,
                "tx_count": 0,
                "gas_limit": 60000000,
                "timestamp": "2026-06-08T18:26:00.000000Z",
                "burnt_fees": "0",
                "difficulty": "0",
                "base_fee_per_gas": "779371350051"
            },
            {
                "hash": "0xf9829f750a869731d5698081e12650d930c30ca01cbce67fdf2f4fe9f5730b11",
                "size": 514,
                "miner": "0x43aB6285DEcab67802086abD369E5E67C2B5cDbc",
                "height": 13620265,
                "gas_used": 0,
                "tx_count": 0,
                "gas_limit": 60000000,
                "timestamp": "2026-06-08T18:25:54.000000Z",
                "burnt_fees": "0",
                "difficulty": "0",
                "base_fee_per_gas": "779371350051"
            },
            {
                "hash": "0x6793c37fb78b4234ef72ee6057d6acce70c95dafa0a3d1f9376fc541a254f924",
                "size": 514,
                "miner": "0x3f290a113faB7A1801517ce3b6975B86B282fd90",
                "height": 13620264,
                "gas_used": 0,
                "tx_count": 0,
                "gas_limit": 60000000,
                
…(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: `0xf0b40b0ff4f35F8812B9DE204ba8955637ECAfD9`

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

**Response:**
```json
{
    "data": {
        "address": {
            "ens": null,
            "hash": "0xf0b40b0ff4f35F8812B9DE204ba8955637ECAfD9",
            "name": null,
            "token": null,
            "creator": null,
            "balance_wei": "744091442145891396676",
            "is_contract": false,
            "is_verified": false,
            "balance_astr": 744.0914421458915
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:35.281Z",
        "request_id": "c6d2c42f-c103-4a41-91ee-a71b0888987b"
    },
    "status": "ok",
    "message": "Address retrieved successfully",
    "success": true
}
```

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

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

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

**Response:**
```json
{
    "data": {
        "transaction": {
            "to": "0x3D9cb3A09142c421Fc0571C9F55D03fa7c86De0B",
            "from": "0xf0b40b0ff4f35F8812B9DE204ba8955637ECAfD9",
            "hash": "0x1a4babca8f63b0b83c362333e182ffbbc98fedef521b8f2beb7ae9e74da434ba",
            "type": 0,
            "block": 13616655,
            "nonce": 10811,
            "method": "transmit",
            "status": "ok",
            "fee_wei": "348801724492990072",
            "fee_astr": 0.3488017244929901,
            "gas_used": 372952,
            "gas_price": "935245620061",
            "timestamp": "2026-06-08T10:55:18.000000Z",
            "value_wei": "0",
            "value_astr": 0,
            "confirmations": 3612
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:35.733Z",
        "request_id": "6eeb7a34-8ea6-4978-968e-14cf13d66a47"
    },
    "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: `0x31EFB841d5e0b4082F7E1267dab8De1b853f2A9d`

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

**Response:**
```json
{
    "data": {
        "token": {
            "icon": "https://assets.coingecko.com/coins/images/877/small/Chainlink_Logo_500.png?1760023405",
            "name": "Chainlink",
            "type": "ERC-20",
            "symbol": "LINK",
            "address": "0x31EFB841d5e0b4082F7E1267dab8De1b853f2A9d",
            "holders": 1,
            "decimals": 18,
            "total_supply": "111111111086",
            "exchange_rate_usd": 8.01,
            "circulating_market_cap": "5824140984.829477"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T18:26:35.911Z",
        "request_id": "1992907a-28e6-4436-8f50-eb1817c50528"
    },
    "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: `astar`

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

**Response:**
```json
{
    "data": {
        "count": 50,
        "query": "astar",
        "results": [
            {
                "name": "Celer Bridged USDC (Astar)",
                "type": "token",
                "symbol": "USDC",
                "address": "0x6a2d262D56735DbA19Dd70682B39F6bE9a931D98"
            },
            {
                "name": "Celer Bridged USDT (Astar)",
                "type": "token",
                "symbol": "USDT",
                "address": "0x3795C36e7D12A8c252A20C5a7B455f7c57b60283"
            },
            {
                "name": "Celer Bridged WETH (Astar)",
                "type": "token",
                "symbol": "WETH",
                "address": "0x81ECac0D6Be0550A00FF064a4f9dd2400585FE9c"
            },
            {
                "name": "Celer Bridged DAI (Astar)",
                "type": "token",
                "symbol": "DAI",
                "address": "0x6De33698e9e9b787e09d3Bd7771ef63557E148bb"
            },
            {
                "name": "Astar Network",
                "type": "token",
                "symbol": "ASTRJP",
                "address": "0x9afF291F0dfAF00fbA7ACf27a93C1af59e176ddC"
            },
            {
                "name": "Calbee AstarFarm Collaboration NFT",
                "type": "token",
                "symbol": "CALBEEASTARFARMCOLLAB",
                "address": "0xecd0311d2F48638217c43FC8baeC03Be922AD996"
            },
            {
                "name": "Wrapped Astar | Dastar.network",

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

### Meta

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

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

**Response:**
```json
{
    "data": {
        "service": "astar-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 Astar (ASTR) mainnet 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:36.626Z",
        "request_id": "9a6c0066-41e5-4ed5-9ee8-2bc4e4dbc105"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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