getAccountInfo - Bitcoin Cash

Returns balance and transaction data for an address, extended public key, or descriptor over WebSocket. This is the WebSocket form of the REST api/v2/address endpoint.

Parameters

ParameterTypeRequiredDescription
descriptorstringYesAddress, extended public key, or descriptor to query
detailsstringNoDetail level: basic, txids, txslight, or txs. Default txids
pageintegerNo1-based page index for transaction history
pageSizeintegerNoHistory items per page
fromintegerNoFirst block height to include
tointegerNoLast block height to include
gapintegerNoDerivation gap limit for xpub queries

Message

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

# then send:
{
    "id": "getblock.io",
    "method": "getAccountInfo",
    "params": {
        "descriptor": "bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a",
        "details": "txids",
        "page": 1,
        "pageSize": 1000
    }
}

Response

json{
    "id": "getblock.io",
    "data": {
        "page": 1,
        "totalPages": 12,
        "itemsOnPage": 1000,
        "address": "bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a",
        "balance": "5593730321",
        "totalReceived": "5593730321",
        "totalSent": "0",
        "unconfirmedBalance": "0",
        "unconfirmedTxs": 0,
        "txs": 11722,
        "txids": [
            "94dec6ad13dd53825c75e280108669ff5b0658ebbd1acd6081e39e4bf620a235",
            "fde470024107b71206c7e658703d80b3c26c41e8c4782fd2b7d59c325e7723d4",
            "fac3b2c9176fb64d4277438585086b3b71efd0406f5eedf8098b9ab6d12aad25"
        ]
    }
}

Response Fields

FieldTypeDescription
addressstringThe queried address or descriptor
balancestringConfirmed balance in satoshis
totalReceivedstringTotal received in satoshis
totalSentstringTotal sent in satoshis
unconfirmedBalancestringUnconfirmed balance in satoshis
unconfirmedTxsintegerNumber of unconfirmed transactions
txsintegerNumber of confirmed transactions
txidsarrayTransaction ids, present when details is txids

CashAddr (bitcoincash:q...) and legacy Base58 (1...) address formats are both accepted. The response echoes the address in the format used in the request.

Use Cases

  • Balance Display: Show the confirmed and unconfirmed balance of an account
  • History Pages: Page through an account's transactions
  • Payment Detection: Read an address balance after a deposit
  • Reconciliation: Compare indexed totals against local bookkeeping

Error Handling

ErrorMessageDescription
errorInvalid addressThe descriptor is malformed
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect