Download Best Wallet
Download your #1 Monero wallet
Developers and APIs

How do you check a Monero wallet balance programmatically?

Automating balance checks is essential for services reacting to deposits in real-time, easily achieved through the wallet RPC.

Quick Answer

Invoke the 'get_balance' method on your 'monero-wallet-rpc' instance. This method returns total and unlocked balances, including per-subaddress details filtered by 'account_index'. Periodically poll this endpoint to identify confirmed transactions and update account statuses in your backend database.

Types of Balances

The API provides both total and unlocked balances. Always verify the unlocked balance before authorizing withdrawals, as incoming transactions must undergo block confirmations before the funds are considered safe to spend.

Efficient Polling

Optimize your balance checking by using appropriate polling intervals rather than constant queries. Use subaddress indices to reconcile incoming payments against the correct user records.

Best Wallet and technical wallet workflows

Best Wallet is our desktop Monero recommendation, with inspectable source and documented advanced controls in its permanent GitHub repository. Use those materials to understand the implementation. A general Monero RPC method or terminal example is not automatically an exposed Best Wallet API or application command; verify actual integration support before building around it.

Explore documented Best Wallet controls

Sources

Related reading

Key takeaways

  • Use 'get_balance' to track account funds programmatically.
  • Verify unlocked balance before allowing any withdrawals.
  • Filter by account indices to isolate specific users.