Bitcoin Cash Blockbook (WebSocket) API

The Blockbook indexer WebSocket interface for Bitcoin Cash: request/response queries (status, account info, UTXOs, transactions, broadcast, fee estimation) plus subscriptions to new blocks and address activity over a persistent connection.

Blockbook (REST) and Blockbook (WebSocket) are provisioned as separate interfaces with their own endpoint URLs. Enabling one does not enable the other. A project that watches an address as well as querying it needs both.

Use WebSocket when subscriptions are required, and REST for one-off queries. A standard Bitcoin Cash JSON-RPC endpoint does not support Blockbook methods, and the Bitcoin Cash Node wallet RPCs such as listunspent are disabled on shared nodes.

Base URL

bashwss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>

The WebSocket endpoint is the access-token root. Do not append /websocket: that path returns 404 Not Found and the upgrade handshake fails before a connection is opened.

Message Envelope

Every request carries an id chosen by the client, a method, and a params object. The server echoes the same id on the matching response, so replies can be correlated on a multiplexed connection.

json{
    "id": "getblock.io",
    "method": "getInfo",
    "params": {}
}

A failed request returns an error object in place of the result:

json{
    "id": "getblock.io",
    "data": {
        "error": {
            "message": "Invalid address"
        }
    }
}

Subscription notifications reuse the id from the subscription request rather than a fixed value. Give each subscription on a connection its own id so pushes can be routed by id without inspecting the payload.

Methods

MethodDescription
getInfoIndexer and backend status
getAccountInfoAddress balance and transaction history
getAccountUtxoUnspent outputs for an address, xpub, or descriptor
getTransactionNormalized transaction by txid
sendTransactionBroadcast a signed, serialized transaction
estimateFeeFee estimate for one or more confirmation targets
subscribeNewBlockSubscribe to new blocks as they are connected
subscribeAddressesSubscribe to activity on a set of addresses

Bitcoin Cash specifics

  • No SegWit. Transactions carry no vsize or witness data; only size is reported, and fee rates are per byte rather than per virtual byte.
  • Address formats. CashAddr (bitcoincash:q...) and legacy Base58 (1...) are both accepted wherever an address is taken.
  • Coin name. getInfo reports name as Bcash, the indexer's internal coin name, and omits the network field that the other Blockbook chains return.
  • Shared genesis. block0Hash is the Bitcoin genesis block, since Bitcoin Cash shares history with Bitcoin up to the 2017 fork, so it cannot be used alone to tell the two chains apart.

Support