getAccountInfo - Zcash

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

Parameters

ParameterTypeRequiredDescription
descriptorstringYesTransparent address (t1, t3), extended public key, or descriptor
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": "t1KfwsnwJeNRVjQGBDZhwKskpQbih2qx5Ua",
        "details": "txids",
        "page": 1,
        "pageSize": 1000
    }
}

Response

json{
    "id": "getblock.io",
    "data": {
        "page": 1,
        "totalPages": 21,
        "itemsOnPage": 1000,
        "address": "t1KfwsnwJeNRVjQGBDZhwKskpQbih2qx5Ua",
        "balance": "14380441165905",
        "totalReceived": "891236821557936",
        "totalSent": "876856380392031",
        "unconfirmedBalance": "0",
        "unconfirmedTxs": 0,
        "txs": 20207,
        "txids": [
            "873df9973be48d17d305ec078fdea2c248c9a0e5b592c67b5909fd0a9280cc9f",
            "be70321bbc4539e1cfe648af49ce77e9a8f4d83936a11980336f4b2682e4e431"
        ]
    }
}

Response Fields

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

Transparent addresses only. Shielded Sapling and Orchard value is encrypted to the holder's viewing key and is never indexed, so a shielded balance cannot be read here or anywhere else on a public endpoint.

Use Cases

  • Balance Display: Show the transparent balance of an account
  • History Pages: Page through an account's transactions
  • Reconciliation: Compare indexed totals against local bookkeeping

Error Handling

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