Skip to content

bx fetch balance

evoskuil edited this page Oct 19, 2014 · 42 revisions

Get the balance in satoshi of one or more Bitcoin addresses.

$ bx fetch-balance --help
Usage: bx fetch-balance [-h] [--config VALUE] [--format VALUE]           
[BITCOIN_ADDRESS]...                                                     

Info: Get the balance in satoshi of one or more Bitcoin addresses.       
Requires an Obelisk server connection.                                   

Options (named):

-c [--config]        The path to the configuration settings file.        
-f [--format]        The output format. Options are 'json', 'xml', 'info'
                     or 'native', defaults to native.                    
-h [--help]          Get a description and instructions for this command.

Arguments (positional):

BITCOIN_ADDRESS      The set of Bitcoin addresses. If not specified the  
                     addresses are read from STDIN.

Example 1

first address on the blockchain

$ bx fetch-balance 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
balance
{
    address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
    received 6538241483
    unconfirmed 6538241483
    confirmed 1538241483
}

These numeric values will change over time as more people send money to Satoshi, and/or the money at this address is spent.

Example 2

--format json

$ bx fetch-balance -f json 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
{
    "balance": {
        "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
        "received": "6538241483",
        "unconfirmed": "6538241483",
        "confirmed": "1538241483"
    }
}

Example 3

--format xml

$ bx fetch-balance -f xml 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
<?xml version="1.0" encoding="utf-8"?>
<balance><address>1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa</address><received>6538241483</received><unconfirmed>6538241483</unconfirmed><confirmed>1538241483</confirmed></balance>
### Example 4
multiple addresses
```sh
$ bx fetch-balance -f xml 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
<?xml version="1.0" encoding="utf-8"?>
<balance><address>1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa</address><received>6538241483</received><unconfirmed>6538241483</unconfirmed><confirmed>1538241483</confirmed></balance>
<?xml version="1.0" encoding="utf-8"?>
<balance><address>1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa</address><received>6538241483</received><unconfirmed>6538241483</unconfirmed><confirmed>1538241483</confirmed></balance>

BX Menu

Clone this wiki locally