Bitcoin Blockbook (WebSocket) API

The Blockbook indexer WebSocket interface for Bitcoin: 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, each with its own endpoint URL. Enabling one does not enable the other. A project that watches an address as well as querying it needs both.

Use WebSocket for subscriptions and REST for one-off queries. A standard Bitcoin JSON-RPC endpoint does not support Blockbook methods.

Blockbook (WebSocket) is available on Mainnet only. Blockbook (REST) is available on both Mainnet and Testnet, so a testnet integration polls REST in place of subscribing.

Base URL

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

Quickstart

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.

bashwscat -c wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>

# then send:
{
    "id": "getblock.io",
    "method": "getInfo",
    "params": {}
}
bash{
    "id": "getblock.io",
    "data": {
        "name": "Bitcoin",
        "shortcut": "BTC",
        "network": "BTC",
        "decimals": 8,
        "version": "unknown",
        "bestHeight": 967494,
        "bestHash": "00000000000000000000890e285e32408f9da4f2d58b620b5703839448b9c70c",
        "block0Hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
        "testnet": false,
        "backend": {
            "version": "310100",
            "subversion": "/Satoshi:31.1.0/"
        }
    }
}

Methods

MethodDescription
getInfoIndexer and backend status
getAccountInfoAddress or xpub 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

Support