# Starknet API
> Live on-chain data from Starknet, the Ethereum Layer 2 zk-rollup built on the Cairo VM and STARK proofs, via a public Starknet JSON-RPC node. Starknet has no externally-owned accounts: every account is a smart contract with native account abstraction, and fees are paid in STRK or ETH. Resolve an address's transaction nonce, the account contract class it runs and its STRK and ETH balances, read straight from the fee-token contracts. Get a block's number, hash, status, timestamp, sequencer and transaction count. Look up any transaction with its type, finality and execution status, the address that sent it and the actual fee paid. Read the live chain state — the chain id, the JSON-RPC spec version, the latest block and whether the node is syncing. Live, no key, nothing stored. Distinct from the XRP Ledger, Stellar, TRON, Aptos, Algorand, Tezos, Cardano, Hedera, Kaspa, Cosmos, Sui, NEAR, MultiversX, Solana and EVM on-chain APIs and from price feeds — this is Starknet's Cairo-account state, balances, blocks and transactions. Perfect for wallets, explorers and analytics apps.

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

## Pricing
- **Free** (Free) — 7,200 calls/Mo, 2 req/s
- **Starter** ($14/Mo) — 144,000 calls/Mo, 5 req/s
- **Pro** ($38/Mo) — 875,000 calls/Mo, 15 req/s
- **Business** ($89/Mo) — 4,600,000 calls/Mo, 40 req/s

## Endpoints

### Account

#### `GET /v1/account` — Account nonce, class + STRK/ETH balances

**Parameters:**
- `address` (query, required, string) — Starknet address (0x…) Example: `0x2a3c3ca257e1ab251cdf73bbefde48ebcc7baf73f9fdb065853b9dc5b07b217`

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

**Response:**
```json
{
    "data": {
        "nonce": 269870,
        "source": "Starknet",
        "address": "0x2a3c3ca257e1ab251cdf73bbefde48ebcc7baf73f9fdb065853b9dc5b07b217",
        "class_hash": "0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003",
        "eth_balance": 0,
        "is_deployed": true,
        "strk_balance": 575.300514
    },
    "meta": {
        "timestamp": "2026-06-10T14:02:15.221Z",
        "request_id": "8e005c6d-3324-4a11-920a-9ed3b4592960"
    },
    "status": "ok",
    "message": "Account retrieved successfully",
    "success": true
}
```

### Transaction

#### `GET /v1/transaction` — Transaction with status and fee

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

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

**Response:**
```json
{
    "data": {
        "hash": "0x505139a5093358d46be55823a3675139d5cbb1da45424e393cd2b17aebde10b",
        "type": "INVOKE",
        "nonce": 269223,
        "source": "Starknet",
        "version": "0x3",
        "fee_unit": "FRI",
        "actual_fee": 0.115675,
        "event_count": 5,
        "block_number": 10660000,
        "sender_address": "0x293bff00bca702b1a495185a7d0670617296d44c4525f621683546a8b4ce1cc",
        "finality_status": "ACCEPTED_ON_L1",
        "execution_status": "SUCCEEDED"
    },
    "meta": {
        "timestamp": "2026-06-10T14:02:15.905Z",
        "request_id": "6cc326d5-a60a-4c52-9379-6ab04920a2d8"
    },
    "status": "ok",
    "message": "Transaction retrieved successfully",
    "success": true
}
```

### Block

#### `GET /v1/block` — Block details

**Parameters:**
- `number` (query, optional, string) — latest, a number or 0x hash Example: `latest`

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

**Response:**
```json
{
    "data": {
        "source": "Starknet",
        "status": "ACCEPTED_ON_L2",
        "timestamp": "2026-06-10T14:02:07.000Z",
        "block_hash": "0x7eb5a5081665a5246d3c9998923ee4c052b6cc57fcf22d839e870fd2a9e0574",
        "l1_da_mode": "BLOB",
        "parent_hash": "0x65e5058d9bab5d6681c46f9620b117e8ca78ab3323265c590b6d3122cf6ac5b",
        "block_number": 10667746,
        "starknet_version": "0.14.2",
        "sequencer_address": "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8",
        "transaction_count": 23
    },
    "meta": {
        "timestamp": "2026-06-10T14:02:16.084Z",
        "request_id": "c5b0e9b3-5d89-491a-8cad-da1417fb3fc1"
    },
    "status": "ok",
    "message": "Block retrieved successfully",
    "success": true
}
```

### Network

#### `GET /v1/network` — Live chain state

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

**Response:**
```json
{
    "data": {
        "source": "Starknet",
        "syncing": false,
        "chain_id": "0x534e5f4d41494e",
        "chain_name": "SN_MAIN",
        "latest_block": 10667746,
        "spec_version": "0.8.1",
        "latest_block_time": "2026-06-10T14:02:07.000Z",
        "latest_block_tx_count": 23
    },
    "meta": {
        "timestamp": "2026-06-10T14:02:16.535Z",
        "request_id": "e65828e2-07b1-49aa-a400-5c6f58de6c65"
    },
    "status": "ok",
    "message": "Network state retrieved successfully",
    "success": true
}
```


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