getAccountInfo - Bitcoin

Returns balance and transaction data for an address, extended public key, or descriptor over WebSocket. The details parameter controls how much data is returned, from a balance-only summary to full transaction objects. This is the WebSocket form of the REST api/v2/address and api/v2/xpub endpoints.

Parameters

ParameterTypeRequiredDescription
descriptorstringYesAddress, extended public key, or descriptor to query
detailsstringNoDetail level: basic, txids, txslight, or txs. Default txids
tokensstringNoWhich xpub-derived addresses to include: nonzero, used, or derived
pageintegerNo1-based page index for transaction history
pageSizeintegerNoHistory items per page
fromintegerNoFirst block height to include when filtering history
tointegerNoLast block height to include when filtering history
gapintegerNoDerivation gap limit for xpub queries, capped by the server

Message

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

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

Response

json{
    "id": "getblock.io",
    "data": {
        "page": 1,
        "totalPages": 1,
        "itemsOnPage": 1000,
        "address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq",
        "balance": "17938214",
        "totalReceived": "17952507",
        "totalSent": "14293",
        "unconfirmedBalance": "0",
        "unconfirmedTxs": 0,
        "txs": 116,
        "txids": [
            "1d51c696eab35d7dad7631516cc0845aaab317fe67cb182782752547541d30ea",
            "a6494142e2e565b5e672d41a37a3eafec2fe5594f22efbb07f421a6cedf473c5"
        ]
    }
}

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
transactionsarrayFull transaction objects, present when details is txs

Use Cases

  • Balance Display: Show the confirmed and unconfirmed balance of an account
  • History Pages: Page through an account's transaction ids or full transactions
  • Wallet Loading: Read a whole xpub wallet in one call
  • Reconciliation: Compare indexed totals against local bookkeeping

At details=basic the mempool figures are not aggregated: unconfirmedBalance is omitted and unconfirmedTxs reports the raw mempool index size for the account. Use txids or higher when pending amounts matter.

Error Handling

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