# Xai API
> Live Xai on-chain data via Blockscout. Xai is a gaming-focused Arbitrum-Orbit L3; gas and balances are in XAI. Network stats, gas prices, latest blocks, a block by height or hash, address detail with XAI balance, a transaction by hash, ERC-20 token metadata and a universal search across addresses, tokens, blocks and transactions. Real data, no key.

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

## Pricing
- **Free** (Free) — 1,250 calls/Mo, 1 req/s
- **Basic** ($15/Mo) — 72,500 calls/Mo, 10 req/s
- **Pro** ($46/Mo) — 470,000 calls/Mo, 20 req/s
- **Mega** ($148/Mo) — 2,150,000 calls/Mo, 50 req/s

## Endpoints

### Network

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

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

**Response:**
```json
{
    "data": {
        "fast": 0.17,
        "slow": 0.17,
        "unit": "gwei",
        "average": 0.17,
        "gas_used_today": "10105304688"
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:26.588Z",
        "request_id": "d1c98bfa-e442-4f52-9747-bd0f9c880639"
    },
    "status": "ok",
    "message": "Gas retrieved successfully",
    "success": true
}
```

#### `GET /v1/stats` — Network statistics

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

**Response:**
```json
{
    "data": {
        "tvl_usd": null,
        "gas_prices": {
            "fast": 0.17,
            "slow": 0.17,
            "average": 0.17
        },
        "total_blocks": 131047921,
        "coin_price_usd": null,
        "gas_used_today": "10105304688",
        "market_cap_usd": 0,
        "total_addresses": "21259418",
        "total_transactions": "1831185603",
        "transactions_today": "173519",
        "network_utilization_percent": 1.2935338133956975e-8
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:26.888Z",
        "request_id": "912262de-497a-4626-a092-fecd2e0708ee"
    },
    "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: `131028399`
- `hash` (query, optional, string) — Block hash

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

**Response:**
```json
{
    "data": {
        "block": {
            "hash": "0x99103402d2089d17e803364e71f2d31ea5dd8dcd1610c2b13cccd3fc869c4f71",
            "size": 884,
            "miner": "0xA4b000000000000000000073657175656e636572",
            "height": 131028399,
            "gas_used": 86694,
            "tx_count": 2,
            "gas_limit": 1125899906842624,
            "timestamp": "2026-06-08T01:55:09.000000Z",
            "burnt_fees": "8669400000000",
            "difficulty": "1",
            "base_fee_per_gas": "100000000"
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:27.181Z",
        "request_id": "de112374-48eb-4cbe-becf-84e43655bb0e"
    },
    "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/xai-api/v1/blocks"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "blocks": [
            {
                "hash": "0x2a51832900a652561df7d2ef0ab328bbca0527a1fc127276608f6d63b9a562a6",
                "size": 1250,
                "miner": "0xA4b000000000000000000073657175656e636572",
                "height": 131049285,
                "gas_used": 260082,
                "tx_count": 4,
                "gas_limit": 1125899906842624,
                "timestamp": "2026-06-08T09:51:15.000000Z",
                "burnt_fees": "26008200000000",
                "difficulty": "1",
                "base_fee_per_gas": "100000000"
            },
            {
                "hash": "0x687527d0299701b08d7d39cb574f39d2fd663efbaeba5ba12340efb45b134abf",
                "size": 884,
                "miner": "0xA4b000000000000000000073657175656e636572",
                "height": 131049284,
                "gas_used": 86694,
                "tx_count": 2,
                "gas_limit": 1125899906842624,
                "timestamp": "2026-06-08T09:51:15.000000Z",
                "burnt_fees": "8669400000000",
                "difficulty": "1",
                "base_fee_per_gas": "100000000"
            },
            {
                "hash": "0x091ea872525d61ea10af902382d8c14f3f4a35f5d3fabbee3613bd6764607c05",
                "size": 884,
                "miner": "0xA4b000000000000000000073657175656e636572",
                "height": 131049283,
                "gas_used": 86694,
                "tx_count": 2,
   
…(truncated, see openapi.json for full schema)
```

### Accounts

#### `GET /v1/address` — Address detail with XAI balance

**Parameters:**
- `address` (query, required, string) — Address hash Example: `0xf86Cc81F4E480CF54Eb013FFe6929a0C2Ad5EdCA`

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

**Response:**
```json
{
    "data": {
        "address": {
            "ens": null,
            "hash": "0xf86Cc81F4E480CF54Eb013FFe6929a0C2Ad5EdCA",
            "name": "UNIGOX USDT",
            "token": {
                "name": "UNIGOX USDT",
                "type": "ERC-20",
                "symbol": "USDT.u"
            },
            "creator": "0x00A72adEB6542916F53dc2d78450CD436320868B",
            "balance_wei": "0",
            "balance_xai": 0,
            "is_contract": true,
            "is_verified": false
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:28.182Z",
        "request_id": "3712d12d-cb54-4b12-8931-6998fab89ea6"
    },
    "status": "ok",
    "message": "Address retrieved successfully",
    "success": true
}
```

### Transactions

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

**Parameters:**
- `hash` (query, required, string) — Transaction hash Example: `0x3ea8a250cfddf9f4579a2b3f80498764f393ef3398280af3e6a31683f00f4e63`

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

**Response:**
```json
{
    "data": {
        "transaction": {
            "to": "0x00000000000000000000000000000000000A4B05",
            "from": "0x00000000000000000000000000000000000A4B05",
            "hash": "0x3ea8a250cfddf9f4579a2b3f80498764f393ef3398280af3e6a31683f00f4e63",
            "type": 106,
            "block": 131028399,
            "nonce": 0,
            "method": "startBlock",
            "status": "ok",
            "fee_wei": "0",
            "fee_xai": 0,
            "gas_used": 0,
            "gas_price": "100000000",
            "timestamp": "2026-06-08T01:55:09.000000Z",
            "value_wei": "0",
            "value_xai": 0,
            "confirmations": 20887
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:29.232Z",
        "request_id": "454cbcb6-36b3-490b-988a-5da441db1c1c"
    },
    "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: `0xf86Cc81F4E480CF54Eb013FFe6929a0C2Ad5EdCA`

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

**Response:**
```json
{
    "data": {
        "token": {
            "icon": null,
            "name": "UNIGOX USDT",
            "type": "ERC-20",
            "symbol": "USDT.u",
            "holders": null,
            "decimals": 6,
            "total_supply": "215000000000",
            "exchange_rate_usd": null,
            "circulating_market_cap": null
        }
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:29.526Z",
        "request_id": "ea3677f7-9f80-4175-a721-aef2ff5d7696"
    },
    "status": "ok",
    "message": "Token retrieved successfully",
    "success": true
}
```

### Search

#### `GET /v1/search` — Universal on-chain search

**Parameters:**
- `q` (query, required, string) — Address, token, block or tx Example: `USD`

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

**Response:**
```json
{
    "data": {
        "count": 34,
        "query": "USD",
        "results": [
            {
                "name": "UNIGOX USDT",
                "type": "token",
                "symbol": "USDT.u",
                "address": "0xf86Cc81F4E480CF54Eb013FFe6929a0C2Ad5EdCA"
            },
            {
                "name": "UNIGOX USDC",
                "type": "token",
                "symbol": "USDC.u",
                "address": "0x37BF70ee0dC89a408De31B79cCCC3152F0C8AF43"
            },
            {
                "name": "UNIGOX USDC",
                "type": "token",
                "symbol": "USDC.u",
                "address": "0xE2F4a7f56105a43DA1A5D75E55ba0D3397ad4B57"
            },
            {
                "name": "USD Coin",
                "type": "token",
                "symbol": "USDC",
                "address": "0x1E3769Bd5fB2e9e9e7D4ED8667c947661F9A82E3"
            },
            {
                "name": "USD Coin (Arb1)",
                "type": "token",
                "symbol": "USDC",
                "address": "0x300a7B57DC85b6A9776E249614aBf0FE5c9905Fb"
            },
            {
                "name": "Tether USD",
                "type": "token",
                "symbol": "USDT",
                "address": "0xB2C565cd7e807e6A1C38bFE32D8FAb9c96ffCeCa"
            },
            {
                "name": "UNIGOX USDC",
                "type": "token",
                "symbol": "USDC.u",
                "address": "0x8Ddc1bc03f43F1dD1d
…(truncated, see openapi.json for full schema)
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "service": "xai-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 Xai 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. Xai is a gaming-focused Arbitrum-Orbit L3; gas and balances are in XAI. Real on-chain data, no key."
    },
    "meta": {
        "timestamp": "2026-06-08T09:51:30.050Z",
        "request_id": "e45a99bb-a41e-4777-8526-2fa72d98985c"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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