# XDC Network API
> Real-time on-chain data for XDC Network (chain-id 50, XinFin) — the enterprise-ready, EVM-compatible Layer-1 using delegated proof-of-stake (XDPoS), focused on trade finance and asset tokenisation, with XDC as its native coin. Query live network status (latest block height, network id, client version), fetch any block by height or the latest one (timestamp, transaction count, gas used / limit, base fee, miner), read the current gas price in wei and gwei, and look up the native XDC balance and transaction count of any address. Accepts both the XDC ecosystem's "xdc"-prefixed addresses and standard "0x" addresses. A keyless, no-account JSON wrapper over the canonical XDC JSON-RPC node — decoded from hex into plain decimals and human-readable XDC so you do not have to. Ideal for explorers, wallets, dashboards, gas estimators and analytics on XDC Network.

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

## Pricing
- **Free** (Free) — 4,700 calls/Mo, 3 req/s
- **Basic** ($14/Mo) — 60,000 calls/Mo, 10 req/s
- **Pro** ($35/Mo) — 220,000 calls/Mo, 25 req/s
- **Mega** ($75/Mo) — 938,000 calls/Mo, 60 req/s

## Endpoints

### Network

#### `GET /v1/status` — Network status (latest block, chain id, client version)

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

**Response:**
```json
{
    "data": {
        "chain": "XDC Network",
        "chain_id": 50,
        "network_id": 50,
        "rpc_healthy": true,
        "latest_block": 103811305,
        "native_symbol": "XDC",
        "client_version": "XDC/v2.6.8-stable/linux-amd64/go1.23.12"
    },
    "meta": {
        "timestamp": "2026-06-15T11:14:30.960Z",
        "request_id": "6e34eabb-dc1f-42e5-ae3e-c005bd8cb136"
    },
    "status": "ok",
    "message": "Chain status retrieved successfully",
    "success": true
}
```

### Blocks

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

**Parameters:**
- `number` (query, optional, string) — Block height (decimal or 0x-hex), or "latest" Example: `50000000`

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

**Response:**
```json
{
    "data": {
        "hash": "0x6897dbf3015d7b9e41ffb42a1339fdbbbf10ed7c7571ab16861e6a9ee7a13a36",
        "miner": "0x0000000000000000000000000000000000000000",
        "number": 50000000,
        "gas_used": 0,
        "gas_limit": 420000000,
        "timestamp": 1662493545,
        "size_bytes": 849,
        "parent_hash": "0x962d2071da90fa231179ced959706f56b9894cc5d8d170c8e3c62df78ce6ad57",
        "timestamp_iso": "2022-09-06T19:45:45.000Z",
        "transaction_count": 1,
        "base_fee_per_gas_wei": null
    },
    "meta": {
        "timestamp": "2026-06-15T11:14:31.168Z",
        "request_id": "3ea7cb9e-1536-4b98-9965-e19c17e91e4d"
    },
    "status": "ok",
    "message": "Block retrieved successfully",
    "success": true
}
```

### Gas

#### `GET /v1/gas` — Current gas price (wei + gwei)

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

**Response:**
```json
{
    "data": {
        "at_block": 103811306,
        "gas_price_wei": "13500000000",
        "native_symbol": "XDC",
        "gas_price_gwei": 13.5
    },
    "meta": {
        "timestamp": "2026-06-15T11:14:31.387Z",
        "request_id": "9983a484-3c0c-4a49-bafc-516140c76373"
    },
    "status": "ok",
    "message": "Gas price retrieved successfully",
    "success": true
}
```

### Accounts

#### `GET /v1/balance` — Native XDC balance and transaction count of an address

**Parameters:**
- `address` (query, required, string) — xdc- or 0x-prefixed 40-hex address Example: `xdc000000000000000000000000000000000000dEaD`

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

**Response:**
```json
{
    "data": {
        "address": "0x000000000000000000000000000000000000dEaD",
        "balance": "0.000007",
        "address_xdc": "xdc000000000000000000000000000000000000dEaD",
        "balance_wei": "7000000000000",
        "native_symbol": "XDC",
        "transaction_count": 0
    },
    "meta": {
        "timestamp": "2026-06-15T11:14:31.606Z",
        "request_id": "cb92f049-c4d8-43ae-8531-9d82454e6688"
    },
    "status": "ok",
    "message": "Balance retrieved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Service metadata

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

**Response:**
```json
{
    "data": {
        "type": "Enterprise-ready EVM Layer-1 (XDPoS consensus)",
        "chain": "XDC Network",
        "network": "mainnet",
        "chain_id": 50,
        "decimals": 18,
        "ecosystem": "XDC Network (XinFin) — EVM-compatible L1 for trade finance and tokenisation, native coin XDC",
        "endpoints": [
            "/v1/status",
            "/v1/block",
            "/v1/gas",
            "/v1/balance",
            "/v1/meta"
        ],
        "description": "XDC Network is an enterprise-ready, EVM-compatible Layer-1 using delegated proof-of-stake (XDPoS), focused on trade finance and asset tokenisation, with XDC as its native coin.",
        "address_note": "XDC addresses are shown with an 'xdc' prefix; this API accepts both 'xdc...' and '0x...' forms.",
        "documentation": "https://xdc-api.oanor.dev",
        "native_symbol": "XDC"
    },
    "meta": {
        "timestamp": "2026-06-15T11:14:31.695Z",
        "request_id": "3016ffdd-cdca-4d9b-b5b6-1ca1dcdb29ea"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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