REST API Documentation
Base URL: /api/v1
Blocks
/block/tipReturns the current chain tip block.
/block/latestReturns the latest block (alias for tip).
/block/<id>Returns a block by height or hash.
/blocks?from=&limit=Returns a paginated list of blocks.
/block/header/height/<height>/rawReturns the raw 80-byte block header as hex for a given height.
/block/headers/latestReturns the 80-byte block header of the current chain tip as a hex string.
/block/headers/resourcesReturns JSON array of downloadable header chunk URLs (2016-block difficulty periods). Each entry has url and label fields.
/block/headers/<from>-<to>Downloads concatenated raw 80-byte headers for a height range as binary. Max 2016 blocks per request. Useful for SPV header chain sync.
/block/count?minerId=<miner>Returns the total number of blocks mined by a specific miner. Response: {"miner": "TAAL", "blocks": 12345}
Transactions
/tx/<txid>Returns a parsed transaction with inputs, outputs, and spend status.
/tx/<txid>/hexReturns the raw transaction as a hex string.
/tx/<txid>/binReturns the raw transaction as binary.
/tx/<txid>/proofReturns the merkle proof for a transaction.
/tx/<txid>/inscription/<vout>Returns the inscription content embedded in the specified output. Served with the original MIME type (e.g. image/png, text/html). Returns 404 if no inscription exists at that output.
/tx/<txid>/beefReturns a BRC-95 Atomic BEEF bundle (transaction + ancestor chain + merkle proofs) as binary. Used for SPV verification.
/tx/<txid>/beef/hexReturns a BRC-95 Atomic BEEF bundle as a hex string.
/tx/<txid>/statusReturns the confirmation status of a transaction.
/tx/<txid>/propagationReturns propagation status across BSV nodes — shows which nodes have seen the transaction and whether it is in mempool or confirmed.
/tx/broadcastBroadcasts a raw transaction. Body: {"rawtx": "hex"}
/tx/broadcast/multiBroadcasts multiple raw transactions. Body: array of hex strings.
Addresses
/address/<addr>Returns address info with balance and UTXO count.
/address/<addr>/txs?page=Returns paginated transaction history for an address.
/address/<addr>/utxos?page=Returns paginated UTXOs for an address.
/address/<addr>/balanceReturns just the balance for an address.
/address/<addr>/scriptsReturns the locking scripts associated with an address.
Script Hash
/script/<hash>/detailsReturns combined details for a script hash: balance, UTXOs, and transaction history in a single response.
TXO
/txo/<txid>/<vout>Returns a specific transaction output.
/txo/<txid>/<vout>/spendReturns the spending transaction for an output, if spent.
Downloads
/download/tx/<txid>Downloads the raw transaction as a binary file.
/download/tx/<txid>/hexDownloads the raw transaction as a hex text file.
/download/tx/<txid>/output/<index>Downloads a specific output script as binary.
/download/tx/<txid>/output/<index>/hexDownloads a specific output script as hex.
/download/tx/<txid>/input/<index>Downloads a specific input script as binary.
/download/tx/<txid>/input/<index>/hexDownloads a specific input script as hex.
Search
/search?q=Auto-detects query type (txid, block hash/height, address) and returns a redirect.
Stats
/stats/summaryReturns chain summary (height, hashrate, difficulty, price, market cap).
/stats/networkReturns daily network statistics (blocks, txs, fees, hashrate).
/stats/miningReturns mining pool distribution.
/stats/mining/histogram?period=<24h|7d|30d>Returns time-bucketed mining data. Bucket sizes: 24h→1h, 7d→6h, 30d→1d. Response: array of {"bucket": "...", "miner": "TAAL", "blocks": 5}
/stats/props/histogram?period=<24h|7d|30d>Returns time-bucketed block property averages (size, tx count, fees). Bucket sizes: 24h→1h, 7d→6h, 30d→1d.
/stats/protocols?days=<7>Returns protocol tag counts from recent transactions. Response: array of {"protocol": "ord", "tx_count": 5000}
/stats/richlist?page=Returns paginated rich list.
/stats/price-historyReturns historical BSV price data.
Exchange Rate
/exchangerateReturns the current BSV exchange rate in USD.
/exchangeratesReturns BSV exchange rates in multiple currencies.
Mempool
/mempoolReturns mempool summary (tx count, size, usage, min fee).
/mempool/statsReturns mempool fee rate and size distribution histograms. Response includes tx_count, total_fee_bsv, avg_fee_bsv, fee_rate_buckets (sat/byte ranges), and size_buckets (byte ranges). Cached for 30 seconds.
/mempool/protocolsReturns detected protocol tags in mempool transactions with counts. Each entry has protocol, short, color, and count. Parses every mempool tx for protocol detection (ORD, BSV21, MAP, B, etc.). Cached for 60 seconds.
Mining
/miner/feesReturns current mining fee statistics.
/policyReturns the current fee policy.
Tools
/tools/decodeDecodes a raw transaction. Body: {"rawtx": "hex"}
/tools/script/decode?hex=Decodes a script hex string.
Health
/healthReturns "ok" if the server is running. (Not under /api/v1 prefix.)
WebSocket
Connect to /ws for real-time updates.
Send subscribe:blocks to receive new block notifications.
Send subscribe:mempool to receive mempool transaction feed.
Send subscribe:address:<addr> to watch an address.
WhatsonChain-Compatible API
A WhatsonChain-compatible API is available at /api/v1/bsv/main. This allows existing applications built for the WoC API to work with BananaBlocks as a drop-in replacement. See the WhatsonChain API docs for endpoint details.