NightForge Explorer API
Public REST API for the Midnight blockchain explorer. All endpoints return JSON unless otherwise noted.
Core
/health
Health check endpoint. Returns service status and current timestamp.
{
"status": "ok",
"timestamp": "2026-03-31T12:00:00.000Z",
"network": "Midnight Preprod"
}
/api/network
Network configuration and node details.
{
"name": "Midnight Preprod",
"rpcEndpoint": "wss://...",
"genesisHash": "0x...",
"chainType": "Live",
"node": { "version": "...", "specVersion": 1 },
"cardanoNetwork": "preprod"
}
/api/stats
Indexer statistics including total blocks, extrinsics, events, and current epoch.
{
"blocks": 150000, "extrinsics": 500000, "events": 1200000,
"totalBlocks": 150000, "totalExtrinsics": 500000, "totalEvents": 1200000,
"latestBlock": 150000,
"epoch": { "epoch": 42, "sidechain_slot": 12345, "mainchain_epoch": 500 }
}
/api/blocks
Paginated list of blocks (newest first).
Params: limit (max 100, default 50), offset (default 0)
[
{ "height": 150000, "hash": "0xabc...", "parent_hash": "0xdef...",
"extrinsics_count": 3, "events_count": 12, "timestamp": 1711882800 }
]
/api/blocks/:heightOrHash
Get a single block by height (number) or hash (hex string).
{
"height": 1, "hash": "0xabc...", "parent_hash": "0xdef...",
"state_root": "0x...", "extrinsics_root": "0x...",
"extrinsics_count": 1, "events_count": 5, "timestamp": 1711800000
}
/api/blocks/:height/extrinsics
All extrinsics in a specific block.
[
{ "hash": "0x...", "block_height": 1, "index": 0, "section": "timestamp",
"method": "set", "signer": null, "success": 1, "timestamp": 1711800000 }
]
/api/blocks/:height/events
All events emitted in a specific block.
[
{ "block_height": 1, "index": 0, "section": "system",
"method": "ExtrinsicSuccess", "data": "..." }
]
/api/extrinsics
Recent extrinsics across all blocks.
Params: limit (max 100, default 50)
[
{ "hash": "0x...", "block_height": 150000, "section": "midnight",
"method": "transact", "signer": "5G...", "success": 1 }
]
/api/extrinsics/:hash
Get a single extrinsic by its hash.
{
"hash": "0x...", "block_height": 150000, "index": 1,
"section": "midnight", "method": "transact",
"signer": "5G...", "args": "0x...", "success": 1
}
/api/extrinsics/:hash/decoded
Get a Midnight extrinsic with decoded transaction details (shielding type, inputs, outputs).
{
"hash": "0x...", "section": "midnight", "method": "transact",
"decoded": { "txType": "transfer", "shieldingType": "shielded", "inputs": 2, "outputs": 2 }
}
/api/extrinsics/stats
Extrinsic statistics: totals, success/fail counts.
{
"total": 500000, "successful": 498000, "failed": 2000
}
/api/search?q=...
Search by block height (number) or hash (block/extrinsic).
Params: q (required) - block height or hex hash
{ "type": "block", "data": { "height": 1, "hash": "0x..." } }
/api/validators
List of known validators, sorted by last seen.
[
{ "address": "5G...", "last_seen": 1711882800, "blocks_produced": 500 }
]
Analytics
/api/analytics/overview
Comprehensive network overview: blocks, TPS, shielded ratio, committee size, epoch info, and more.
{
"network": "Midnight Preprod", "blocks": 150000, "extrinsics": 500000,
"midnightTxs": 120000, "bridgeOps": 5000, "avgBlockTime": 6.2,
"tps": 1.3, "shieldedRatio": 0.85, "contractDeploys": 45,
"contractCalls": 80000, "committeeSize": 7
}
/api/analytics/extrinsic-types
Top 20 extrinsic types by frequency (section + method).
[
{ "section": "midnight", "method": "transact", "count": 120000 },
{ "section": "timestamp", "method": "set", "count": 150000 }
]
/api/analytics/block-rate
Hourly block production and extrinsic counts.
Params: hours (default 24)
[
{ "hour": 1711882800, "blocks": 600, "extrinsics": 1800 }
]
/api/analytics/tx-classification
Classifies recent Midnight transactions as shielded/unshielded/mixed.
Params: limit (max 2000, default 500)
{
"analyzed": 500,
"shielding": { "shielded": 400, "unshielded": 50, "mixed": 30, "unknown": 20 },
"types": { "transfer": 300, "contract_call": 150, "deploy": 50 }
}
/api/analytics/events
Event type breakdown across all indexed blocks.
[
{ "section": "system", "method": "ExtrinsicSuccess", "count": 490000 },
{ "section": "midnight", "method": "Transacted", "count": 120000 }
]
/analytics/volume
Hourly transaction volume.
Params: hours (default 24)
[
{ "hour": "2026-03-31 12:00:00", "count": 150 }
]
Privacy
/api/analytics/privacy
Privacy dashboard: shielded/unshielded ratios, contract deploys/calls, and trends (event-based).
Params: hours (max 168, default 24). Cached for 60s.
{
"totalMidnightTxs": 500, "shielded": 400, "unshielded": 80,
"contractDeploys": 5, "contractCalls": 120,
"shieldedRatio": 0.83, "trend": [...]
}
/api/privacy-score
Composite Privacy Health Score — weighted metric combining shielded ratio, network activity, decentralization, and ecosystem diversity. Unique to NightForge.
{
"privacyHealthScore": 72, "grade": "B+",
"breakdown": {
"shieldedRatio": { "score": 100, "weight": "40%", "value": "83.0% shielded" },
"networkActivity": { "score": 50, "weight": "25%", "value": "0.250 TPS" },
"decentralization": { "score": 60, "weight": "20%", "value": "12 validators" },
"ecosystemDiversity": { "score": 40, "weight": "15%", "value": "20 contracts" }
},
"interpretation": "Midnight privacy health is good. Room for improvement..."
}
/api/midnight-txs
Recent Midnight-specific transactions with decoded shielding info.
Params: limit (max 100, default 20)
[
{ "hash": "0x...", "block_height": 150000, "timestamp": 1711882800,
"signer": "5G...", "shieldingType": "shielded", "txType": "transfer" }
]
Bridge
/api/analytics/bridge
Cardano bridge operations: totals, trends, and recent bridge transactions.
Params: hours (max 168, default 24)
{
"totalBridgeOps": 5000, "last24h": 120, "trend": [...],
"recentBridgeOps": [
{ "hash": "0x...", "block_height": 149990, "timestamp": 1711882000,
"args_summary": "Cardano block #12345 (0xabc...)" }
]
}
Governance
/api/governance
Governance dashboard: committee updates, proposals, and voting data.
{
"committeeUpdates": [...],
"recentGovernanceEvents": [...]
}
/api/committee
Current committee members and their status.
[
{ "address": "5G...", "role": "member", "since_epoch": 10 }
]
Epochs
/api/epoch
Current epoch information: sidechain epoch/slot, mainchain epoch/slot.
{
"epoch": 42, "sidechain_slot": 12345,
"mainchain_epoch": 500, "mainchain_slot": 130000000
}
/api/epochs
Epoch timeline: historical epoch data.
Params: limit (max 200, default 50)
[
{ "epoch": 42, "sidechain_slot": 12345, "mainchain_epoch": 500,
"block_height": 149000, "timestamp": 1711880000 }
]
Cardano
/api/cardano-anchors
Cardano anchor points: sidechain state anchored to Cardano.
Params: limit (max 200, default 50)
[
{ "block_height": 149500, "mainchain_block": 12345678,
"mainchain_hash": "0x...", "timestamp": 1711881000 }
]
Contracts
/api/analytics/contracts
Contract leaderboard: most active contracts by call count.
{
"contracts": [
{ "address": "0x...", "calls": 5000, "deploys": 1, "last_call": 1711882800 }
]
}
/api/contracts/deployed
All deployed contract addresses discovered from on-chain events.
[
{ "address": "0x...", "deployed_at_block": 50000, "deployer": "5G..." }
]