# Oasis Sapphire API
> Real-time on-chain data for Oasis Sapphire (chain-id 23294) — the confidential EVM-compatible ParaTime on the Oasis Network that brings on-chain privacy to smart contracts, with ROSE as its native token. 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 ROSE balance and transaction count of any address. A keyless, no-account JSON wrapper over the canonical Sapphire JSON-RPC node — decoded from hex into plain decimals and human-readable ROSE so you do not have to. Ideal for explorers, wallets, dashboards, gas estimators and analytics on Oasis Sapphire.

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

## Pricing
- **Free** (Free) — 4,300 calls/Mo, 3 req/s
- **Basic** ($13/Mo) — 57,000 calls/Mo, 10 req/s
- **Pro** ($33/Mo) — 214,000 calls/Mo, 25 req/s
- **Mega** ($73/Mo) — 896,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/sapphire-api/v1/status"
```

**Response:**
```json
{
    "data": {
        "chain": "Oasis Sapphire",
        "chain_id": 23294,
        "network_id": 23294,
        "rpc_healthy": true,
        "latest_block": 14419478,
        "native_symbol": "ROSE",
        "client_version": "oasis/5.3.4/go1.24.7"
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:13.297Z",
        "request_id": "8d51566b-993d-43b9-9f39-9753769a1839"
    },
    "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: `5000000`

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

**Response:**
```json
{
    "data": {
        "hash": "0x73078e1484f34ea7282a9b97a3f50ddf82d801f4eb413f0de0a7d4cae70cff45",
        "miner": "0x0000000000000000000000000000000088888888",
        "number": 5000000,
        "gas_used": 520788,
        "gas_limit": 15000000,
        "timestamp": 1723603297,
        "size_bytes": 7033,
        "parent_hash": "0xb7afe26ed828b639bac72c145afdce296d3d15cec79b619ab0346748910fbec5",
        "timestamp_iso": "2024-08-14T02:41:37.000Z",
        "transaction_count": 7,
        "base_fee_per_gas_wei": null
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:13.542Z",
        "request_id": "44950adb-70dc-48f1-b4de-de2c1f76089a"
    },
    "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/sapphire-api/v1/gas"
```

**Response:**
```json
{
    "data": {
        "at_block": 14419478,
        "gas_price_wei": "100000000000",
        "native_symbol": "ROSE",
        "gas_price_gwei": 100
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:13.780Z",
        "request_id": "497e20bb-5a6e-4650-b985-dd2925544f50"
    },
    "status": "ok",
    "message": "Gas price retrieved successfully",
    "success": true
}
```

### Accounts

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

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

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

**Response:**
```json
{
    "data": {
        "address": "0x000000000000000000000000000000000000dEaD",
        "balance": "0.00776610637329577",
        "balance_wei": "7766106373295770",
        "native_symbol": "ROSE",
        "transaction_count": 0
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:14.050Z",
        "request_id": "17d27418-d40d-4c5f-9389-9438815644d0"
    },
    "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/sapphire-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "type": "Confidential EVM ParaTime (Oasis Network)",
        "chain": "Oasis Sapphire",
        "network": "mainnet",
        "chain_id": 23294,
        "decimals": 18,
        "ecosystem": "Oasis Sapphire — the confidential EVM-compatible ParaTime on the Oasis Network, native token ROSE",
        "endpoints": [
            "/v1/status",
            "/v1/block",
            "/v1/gas",
            "/v1/balance",
            "/v1/meta"
        ],
        "description": "Oasis Sapphire is the confidential EVM-compatible ParaTime on the Oasis Network, bringing on-chain privacy to smart contracts, with ROSE as its native token.",
        "documentation": "https://sapphire-api.oanor.dev",
        "native_symbol": "ROSE"
    },
    "meta": {
        "timestamp": "2026-06-15T20:41:14.148Z",
        "request_id": "913c97da-f17d-432f-89e5-c60288910e29"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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