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
| Method | Description |
|---|---|
| getInfo | Indexer and backend status |
| getAccountInfo | Address balance and transaction history |
| getAccountUtxo | Unspent outputs for an address, xpub, or descriptor |
| getTransaction | Normalized transaction by txid |
| sendTransaction | Broadcast a signed, serialized transaction |
| estimateFee | Fee estimate for one or more confirmation targets |
| subscribeNewBlock | Subscribe to new blocks as they are connected |
| subscribeAddresses | Subscribe to activity on a set of addresses |
Bitcoin Cash specifics
- No SegWit. Transactions carry no
vsizeor witness data; onlysizeis 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.
getInforeportsnameasBcash, the indexer's internal coin name, and omits thenetworkfield that the other Blockbook chains return. - Shared genesis.
block0Hashis 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
- Support: support@getblock.io