# Sophon Chain API
> Real-time on-chain data for Sophon (chain-id 50104), a ZK Layer-2 built on the zkSync Elastic Chain stack and focused on consumer and entertainment apps, where gas is paid in the native SOPH token. The status endpoint returns the chain id, network id, latest block height, native symbol and node client version so you can confirm the chain is live and synced. The block endpoint returns a block by decimal or 0x-hex height — or the latest block when no height is given — with its hash, parent hash, timestamp (raw and ISO), transaction count, gas used and limit, base fee and miner. The gas endpoint returns the current gas price in both wei and gwei at the latest block. The balance endpoint returns the native SOPH balance (in wei and human-readable units) and the transaction count (nonce) for any 0x address. The meta endpoint documents the chain id, decimals and ecosystem. Reads a live Sophon JSON-RPC node directly, so values are current to the latest block. Live, nothing stored. 5 endpoints. This serves native-coin and chain data; for ERC-20 token balances or contract calls use a dedicated token/contract API.

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

## Pricing
- **Free** (Free) — 290 calls/Mo, 2 req/s
- **Basic** ($13/Mo) — 22,400 calls/Mo, 5 req/s
- **Pro** ($33/Mo) — 117,500 calls/Mo, 20 req/s
- **Mega** ($74/Mo) — 518,000 calls/Mo, 60 req/s

## Endpoints

### Chain

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

**Parameters:**
- `number` (query, optional, string) — Block height (decimal or 0x-hex) or 'latest'. Omit for the latest block. Example: `5000000`

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

**Response:**
```json
{
    "data": {
        "hash": "0xb1d6bcaf2baa982e9f41e635e9ca3041a2eee0bf49079811e4c275212496517a",
        "miner": "0x0000000000000000000000000000000000000000",
        "number": 5000000,
        "gas_used": 620195,
        "gas_limit": 1125899906842624,
        "timestamp": 1739687366,
        "size_bytes": 0,
        "parent_hash": "0x8ab69af6126406e0fc03f29b51e9276e2b0ffb6c23a9ece0a28355f29d871acf",
        "timestamp_iso": "2025-02-16T06:29:26.000Z",
        "transaction_count": 5,
        "base_fee_per_gas_wei": "2070973792921"
    },
    "meta": {
        "timestamp": "2026-06-15T20:40:29.572Z",
        "request_id": "9d599a81-3786-4060-bd17-e15f513bd4b3"
    },
    "status": "ok",
    "message": "Block retrieved successfully",
    "success": true
}
```

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

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

**Response:**
```json
{
    "data": {
        "at_block": 29483592,
        "gas_price_wei": "10000000000000",
        "native_symbol": "SOPH",
        "gas_price_gwei": 10000
    },
    "meta": {
        "timestamp": "2026-06-15T20:40:29.728Z",
        "request_id": "f8126ed8-a9a7-4ed3-8e04-e8f3a65a0c9a"
    },
    "status": "ok",
    "message": "Gas price retrieved successfully",
    "success": true
}
```

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

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

**Response:**
```json
{
    "data": {
        "chain": "Sophon",
        "chain_id": 50104,
        "network_id": 50104,
        "rpc_healthy": true,
        "latest_block": 29483592,
        "native_symbol": "SOPH",
        "client_version": "zkSync/v2.0"
    },
    "meta": {
        "timestamp": "2026-06-15T20:40:29.894Z",
        "request_id": "a87bf246-112d-408d-a48b-400f04aadca1"
    },
    "status": "ok",
    "message": "Chain status retrieved successfully",
    "success": true
}
```

### Account

#### `GET /v1/balance` — Native SOPH balance for 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/sophon-api/v1/balance?address=0x000000000000000000000000000000000000dEaD"
```

**Response:**
```json
{
    "data": {
        "address": "0x000000000000000000000000000000000000dEaD",
        "balance": "0",
        "balance_wei": "0",
        "native_symbol": "SOPH",
        "transaction_count": 0
    },
    "meta": {
        "timestamp": "2026-06-15T20:40:30.025Z",
        "request_id": "4652d24b-6561-447c-b833-8a41d7678509"
    },
    "status": "ok",
    "message": "Balance retrieved successfully",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "type": "zkSync-stack ZK rollup (Ethereum L2)",
        "chain": "Sophon",
        "network": "mainnet",
        "chain_id": 50104,
        "decimals": 18,
        "ecosystem": "Sophon — a ZK Layer-2 built on the zkSync Elastic Chain stack, focused on consumer/entertainment apps; gas is paid in the native SOPH token.",
        "endpoints": [
            "/v1/status",
            "/v1/block",
            "/v1/gas",
            "/v1/balance",
            "/v1/meta"
        ],
        "documentation": "https://sophon-api.oanor.dev",
        "native_symbol": "SOPH"
    },
    "meta": {
        "timestamp": "2026-06-15T20:40:30.115Z",
        "request_id": "59a411ae-53c8-4dd1-8253-4c863c1871cd"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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