REST API Documentation

Base URL: /api/v1

Blocks

GET /block/tip

Returns the current chain tip block.

GET /block/latest

Returns the latest block (alias for tip).

GET /block/<id>

Returns a block by height or hash.

GET /blocks?from=&limit=

Returns a paginated list of blocks.

GET /block/header/height/<height>/raw

Returns the raw 80-byte block header as hex for a given height.

GET /block/headers/latest

Returns the 80-byte block header of the current chain tip as a hex string.

GET /block/headers/resources

Returns JSON array of downloadable header chunk URLs (2016-block difficulty periods). Each entry has url and label fields.

GET /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.

GET /block/count?minerId=<miner>

Returns the total number of blocks mined by a specific miner. Response: {"miner": "TAAL", "blocks": 12345}

Transactions

GET /tx/<txid>

Returns a parsed transaction with inputs, outputs, and spend status.

GET /tx/<txid>/hex

Returns the raw transaction as a hex string.

GET /tx/<txid>/bin

Returns the raw transaction as binary.

GET /tx/<txid>/proof

Returns the merkle proof for a transaction.

GET /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.

GET /tx/<txid>/beef

Returns a BRC-95 Atomic BEEF bundle (transaction + ancestor chain + merkle proofs) as binary. Used for SPV verification.

GET /tx/<txid>/beef/hex

Returns a BRC-95 Atomic BEEF bundle as a hex string.

GET /tx/<txid>/status

Returns the confirmation status of a transaction.

GET /tx/<txid>/propagation

Returns propagation status across BSV nodes — shows which nodes have seen the transaction and whether it is in mempool or confirmed.

POST /tx/broadcast

Broadcasts a raw transaction. Body: {"rawtx": "hex"}

POST /tx/broadcast/multi

Broadcasts multiple raw transactions. Body: array of hex strings.

Addresses

GET /address/<addr>

Returns address info with balance and UTXO count.

GET /address/<addr>/txs?page=

Returns paginated transaction history for an address.

GET /address/<addr>/utxos?page=

Returns paginated UTXOs for an address.

GET /address/<addr>/balance

Returns just the balance for an address.

GET /address/<addr>/scripts

Returns the locking scripts associated with an address.

Script Hash

GET /script/<hash>/details

Returns combined details for a script hash: balance, UTXOs, and transaction history in a single response.

TXO

GET /txo/<txid>/<vout>

Returns a specific transaction output.

GET /txo/<txid>/<vout>/spend

Returns the spending transaction for an output, if spent.

Downloads

GET /download/tx/<txid>

Downloads the raw transaction as a binary file.

GET /download/tx/<txid>/hex

Downloads the raw transaction as a hex text file.

GET /download/tx/<txid>/output/<index>

Downloads a specific output script as binary.

GET /download/tx/<txid>/output/<index>/hex

Downloads a specific output script as hex.

GET /download/tx/<txid>/input/<index>

Downloads a specific input script as binary.

GET /download/tx/<txid>/input/<index>/hex

Downloads a specific input script as hex.

Search

GET /search?q=

Auto-detects query type (txid, block hash/height, address) and returns a redirect.

Stats

GET /stats/summary

Returns chain summary (height, hashrate, difficulty, price, market cap).

GET /stats/network

Returns daily network statistics (blocks, txs, fees, hashrate).

GET /stats/mining

Returns mining pool distribution.

GET /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}

GET /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.

GET /stats/protocols?days=<7>

Returns protocol tag counts from recent transactions. Response: array of {"protocol": "ord", "tx_count": 5000}

GET /stats/richlist?page=

Returns paginated rich list.

GET /stats/price-history

Returns historical BSV price data.

Exchange Rate

GET /exchangerate

Returns the current BSV exchange rate in USD.

GET /exchangerates

Returns BSV exchange rates in multiple currencies.

Mempool

GET /mempool

Returns mempool summary (tx count, size, usage, min fee).

GET /mempool/stats

Returns 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.

GET /mempool/protocols

Returns 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

GET /miner/fees

Returns current mining fee statistics.

GET /policy

Returns the current fee policy.

Tools

POST /tools/decode

Decodes a raw transaction. Body: {"rawtx": "hex"}

GET /tools/script/decode?hex=

Decodes a script hex string.

Health

GET /health

Returns "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.