# Matchain API
> Live EVM on-chain data for Matchain (chain id 698) — the BNB-Chain-secured Layer-2 focused on decentralised identity and social, where gas is paid in BNB — served directly from the public Matchain JSON-RPC with server-side resilience. The status endpoint returns the chain and network id, the latest block height and the node client version. The block endpoint returns a block by number (or the latest) with its hash, parent hash, timestamp, transaction count, gas used and gas limit, miner and size. The gas endpoint returns the current gas price in both wei and gwei. The balance endpoint returns the BNB balance and outgoing transaction count for any address, converted from base wei (18 decimals) into whole BNB with exact big-integer scaling. Every figure is read live from the chain over JSON-RPC — nothing bundled or modelled — behind a short server-side cache with keep-warm so the feed stays fast and fresh. Ideal for explorers, wallet and dashboard tooling, gas trackers, address monitors and analytics apps across the Matchain identity and social ecosystem. Live keyless upstream. 5 endpoints.

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

## Pricing
- **Free** (Free) — 360 calls/Mo, 2 req/s
- **Starter** ($13/Mo) — 16,800 calls/Mo, 8 req/s
- **Pro** ($36/Mo) — 82,000 calls/Mo, 16 req/s
- **Mega** ($86/Mo) — 338,000 calls/Mo, 40 req/s

## Endpoints

### Matchain

#### `GET /v1/balance` — Address balance & tx count

**Parameters:**
- `address` (query, optional, string) — EVM address (0x + 40 hex) Example: `0x000000000000000000000000000000000000dEaD`

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

**Response:**
```json
{
    "data": {
        "chain": "Matchain",
        "symbol": "BNB",
        "address": "0x000000000000000000000000000000000000dEaD",
        "balance": 0.004378,
        "tx_count": 0,
        "balance_wei": "4378790096976563"
    },
    "meta": {
        "timestamp": "2026-06-15T20:40:09.371Z",
        "request_id": "24ca5b4b-0390-491f-a177-bd2a85cd18cf"
    },
    "status": "ok",
    "message": "Matchain balance retrieved",
    "success": true
}
```

#### `GET /v1/block` — Block by number (or latest)

**Parameters:**
- `number` (query, optional, string) — Block number; omit for latest Example: `5000000`

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

**Response:**
```json
{
    "data": {
        "hash": "0xaece1dc572f44bb9aecaaf3140235aff1c25d428e6819aca4ad24218cf41d084",
        "chain": "Matchain",
        "miner": "0x4200000000000000000000000000000000000011",
        "number": 5000000,
        "gas_used": 43839,
        "tx_count": 1,
        "gas_limit": 100000000,
        "timestamp": 1726308788,
        "size_bytes": 838,
        "parent_hash": "0xd8ce9dee02f3be1502520d79378de35d1281b07a75c40fbd24f74e60cd990171",
        "timestamp_iso": "2024-09-14T10:13:08.000Z"
    },
    "meta": {
        "timestamp": "2026-06-15T20:40:09.620Z",
        "request_id": "cce77f16-5348-4098-8200-04744f8ae960"
    },
    "status": "ok",
    "message": "Matchain block retrieved",
    "success": true
}
```

#### `GET /v1/gas` — Current gas price

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

**Response:**
```json
{
    "data": {
        "chain": "Matchain",
        "source": "eth_gasPrice",
        "symbol": "BNB",
        "gas_price_wei": 1000000,
        "gas_price_gwei": 0.001
    },
    "meta": {
        "timestamp": "2026-06-15T20:40:09.873Z",
        "request_id": "a059261a-4a59-4564-80c0-8e427fe09606"
    },
    "status": "ok",
    "message": "Matchain gas retrieved",
    "success": true
}
```

#### `GET /v1/status` — Chain status

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

**Response:**
```json
{
    "data": {
        "chain": "Matchain",
        "source": "Matchain EVM RPC",
        "symbol": "BNB",
        "chain_id": 698,
        "network_id": 698,
        "latest_block": 123754845,
        "client_version": "Geth/v0.5.10-stable-1b995c36/linux-amd64/go1.21.13"
    },
    "meta": {
        "timestamp": "2026-06-15T20:40:10.489Z",
        "request_id": "64b14b48-bc50-4103-94f1-45e46f5cb718"
    },
    "status": "ok",
    "message": "Matchain status retrieved",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "api": "Matchain API",
        "chain": "Matchain",
        "source": "Matchain EVM JSON-RPC nodes",
        "symbol": "BNB",
        "chain_id": 698,
        "endpoints": [
            "/v1/status",
            "/v1/block",
            "/v1/gas",
            "/v1/balance",
            "/v1/meta"
        ],
        "description": "Live EVM on-chain data for Matchain — the BNB-secured Layer-2 for decentralised identity and social, gas paid in BNB.",
        "documentation": "https://matchain-api.oanor.dev"
    },
    "meta": {
        "timestamp": "2026-06-15T20:40:10.566Z",
        "request_id": "70971be4-7919-4284-acc9-2dfe1ebc7af2"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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