getbalance

wallet wallet since 0.3.18

returns the total available balance.

Share: X Bluesky Mastodon Reddit HN
↑ shares the docs page. Use Share this query below for a link with your current arg values.
Wallet RPC, not available on our node. Wallet operation. Our node runs without a wallet, so this RPC is structurally unreachable here. Docs are kept for reference.
Call from your own code

Replace $BITCOIN_RPC_USER / $BITCOIN_RPC_PASSWORD with credentials from your bitcoind's bitcoin.conf, and replace localhost:8332 with your node's RPC address. You can't run this RPC against our node (we run wallet=0), but you can run it against your own bitcoind.

Help

getbalance ( "dummy" minconf include_watchonly avoid_reuse )

Returns the total available balance.
The available balance is what the wallet considers currently spendable, and is
thus affected by options which limit spendability such as -spendzeroconfchange.

Arguments:
1. dummy                (string, optional) Remains for backward compatibility. Must be excluded or set to "*".
2. minconf              (numeric, optional, default=0) Only include transactions confirmed at least this many times.
3. include_watchonly    (boolean, optional, default=true for watch-only wallets, otherwise false) Also include balance in watch-only addresses (see 'importaddress')
4. avoid_reuse          (boolean, optional, default=true) (only available if avoid_reuse wallet flag is set) Do not include balance in dirty outputs; addresses are considered dirty if they have previously been used in a transaction.

Result:
n    (numeric) The total amount in BTC received for this wallet.

Examples:

The total amount in the wallet with 0 or more confirmations
> bitcoin-cli getbalance 

The total amount in the wallet with at least 6 confirmations
> bitcoin-cli getbalance "*" 6

As a JSON-RPC call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getbalance", "params": ["*", 6]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
← back to all RPCs