# ApeChain Chain API
> Live on-chain data for ApeChain — the ApeCoin DAO Layer 2 — 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 APE balance, nonce, contract flag and token holdings; transaction resolves a tx by hash with its from/to, value in APE, 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 APE, 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/apechain-api/..."
```

## Pricing
- **Free** (Free) — 5,400 calls/Mo, 2 req/s
- **Basic** ($33/Mo) — 152,000 calls/Mo, 8 req/s
- **Pro** ($100/Mo) — 845,000 calls/Mo, 20 req/s
- **Mega** ($335/Mo) — 4,850,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/apechain-api/v1/gas"
```

**Response:**
```json
{
    "data": {
        "fast": 97.73,
        "slow": 97.73,
        "unit": "gwei",
        "average": 97.73,
        "gas_used_today": "18782267410"
    },
    "meta": {
        "timestamp": "2026-06-08T09:48:59.913Z",
        "request_id": "8f54ebd3-3a0d-4cfc-a296-730334d9ed18"
    },
    "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/apechain-api/v1/stats"
```

**Response:**
```json
{
    "data": {
        "tvl_usd": null,
        "gas_prices": {
            "fast": 97.73,
            "slow": 97.73,
            "average": 97.73
        },
        "total_blocks": 39345572,
        "coin_price_usd": null,
        "gas_used_today": "18782267410",
        "market_cap_usd": 0,
        "total_addresses": "5232156",
        "total_transactions": "126251217",
        "transactions_today": "96532",
        "network_utilization_percent": 3.9903813586761316e-8
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:00.221Z",
        "request_id": "8b81218b-5163-4b52-acfd-332987b1fd6c"
    },
    "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: `39379419`
- `hash` (query, optional, string) — Block hash (alternative to height)

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

**Response:**
```json
{
    "data": {
        "block": {
            "hash": "0x50b3bf55a959068ed832a3a4213d611b2c917527a0465b4977d0a65483f5145e",
            "size": 2007,
            "miner": "0xA4b000000000000000000073657175656e636572",
            "height": 39379419,
            "gas_used": 254365,
            "tx_count": 2,
            "gas_limit": 1125899906842624,
            "timestamp": "2026-06-08T07:03:33.000000Z",
            "burnt_fees": "25864535247400000",
            "difficulty": "1",
            "base_fee_per_gas": "101682760000"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:00.578Z",
        "request_id": "8786f1d1-c801-414e-878a-0b02709d9bcb"
    },
    "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/apechain-api/v1/blocks"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "blocks": [
            {
                "hash": "0x287bc5dd242b09cd77c5970a5d11009c3ec570bf308cc3794e421e39881381b1",
                "size": 953,
                "miner": "0xA4b000000000000000000073657175656e636572",
                "height": 39386157,
                "gas_used": 172464,
                "tx_count": 2,
                "gas_limit": 1125899906842624,
                "timestamp": "2026-06-08T09:48:59.000000Z",
                "burnt_fees": "17536615520640000",
                "difficulty": "1",
                "base_fee_per_gas": "101682760000"
            },
            {
                "hash": "0xf878d86b77249b4a4d62ef08dd6f51521a8674094c1a763826eb7fed750411a2",
                "size": 1214,
                "miner": "0xA4b000000000000000000073657175656e636572",
                "height": 39386156,
                "gas_used": 859929,
                "tx_count": 2,
                "gas_limit": 1125899906842624,
                "timestamp": "2026-06-08T09:48:58.000000Z",
                "burnt_fees": "87439954124040000",
                "difficulty": "1",
                "base_fee_per_gas": "101682760000"
            },
            {
                "hash": "0x9c113c2b4d505ee0a8f92809170fa7ce30c89df865adb4b4bae88e201957412b",
                "size": 953,
                "miner": "0xA4b000000000000000000073657175656e636572",
                "height": 39386155,
                "gas_used": 320048,
                "tx_co
…(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: `0xCfdEe1E80f67d45761F321f3c9eCB28AAe769810`

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

**Response:**
```json
{
    "data": {
        "address": {
            "ens": null,
            "hash": "0xCfdEe1E80f67d45761F321f3c9eCB28AAe769810",
            "name": null,
            "token": null,
            "creator": null,
            "balance_ape": 166.1572865920117,
            "balance_wei": "166157286592011706571",
            "is_contract": false,
            "is_verified": false
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:01.560Z",
        "request_id": "6cf0e416-fb07-42fa-ad80-5e2534acca92"
    },
    "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: `0x85c930da7249b62653992c5c695e1e93aedcb5b0048f4679bb161037f72e752d`

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

**Response:**
```json
{
    "data": {
        "transaction": {
            "to": "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
            "from": "0xCfdEe1E80f67d45761F321f3c9eCB28AAe769810",
            "hash": "0x85c930da7249b62653992c5c695e1e93aedcb5b0048f4679bb161037f72e752d",
            "type": 2,
            "block": 39379419,
            "nonce": 84687,
            "method": "handleOps",
            "status": "ok",
            "fee_ape": 0.0258645352474,
            "fee_wei": "25864535247400000",
            "gas_used": 254365,
            "gas_price": "101682760000",
            "timestamp": "2026-06-08T07:03:33.000000Z",
            "value_ape": 0,
            "value_wei": "0",
            "confirmations": 6739
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:01.863Z",
        "request_id": "37b07735-f012-40c2-9f0b-d65f1986f28e"
    },
    "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: `0x75785fc84D68C9848feC6ed602118c129db20367`

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

**Response:**
```json
{
    "data": {
        "token": {
            "icon": null,
            "name": "Arbinaut",
            "type": "ERC-721",
            "symbol": "APENAUT",
            "address": "0x75785fc84D68C9848feC6ed602118c129db20367",
            "holders": 406154,
            "decimals": null,
            "total_supply": "1228757",
            "exchange_rate_usd": null,
            "circulating_market_cap": null
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:02.161Z",
        "request_id": "b7f20cbb-f69d-49ea-864b-01a4562b5738"
    },
    "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: `APENAUT`

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

**Response:**
```json
{
    "data": {
        "count": 3,
        "query": "APENAUT",
        "results": [
            {
                "name": "Arbinaut",
                "type": "token",
                "symbol": "APENAUT",
                "address": "0x75785fc84D68C9848feC6ed602118c129db20367"
            },
            {
                "name": "APENAUTA",
                "type": "token",
                "symbol": "APENAUTA",
                "address": "0xC4D342e2d330f713692F9EA695BED9E08FD00e74"
            },
            {
                "name": "Arbinaut",
                "type": "token",
                "symbol": "APENAUT",
                "address": "0x4B58509aC08a49F562f3B91348c34DFC6d99032D"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:02.491Z",
        "request_id": "6070f553-09af-4676-badc-b3abaa6f90ac"
    },
    "status": "ok",
    "message": "Search results retrieved successfully",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "service": "apechain-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 ApeChain 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. ApeChain is the ApeCoin DAO Layer 2; gas, balances and fees are in APE. Real on-chain data, no key."
    },
    "meta": {
        "timestamp": "2026-06-08T09:49:02.591Z",
        "request_id": "d690850d-86d6-4ea6-9d9b-504452287658"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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