<p>If you want to get balance by using address, then you should try :</p>

<pre><code>BitcoinJSONRPCClient tr = new BitcoinJSONRPCClient();

tr.gettransaction("txnId");
</code></pre>

<p>It will give you the Balance and everything related to that particular address. </p>

<p>I hope this will help. </p>

CC BY-SA 3.0
2017-12-19T08:35:37.383Z
2017-12-19T08:35:37.383Z
Pawan Tiwari
<p>If the address is not in your wallet that is not possible with the current <code>bitcoind</code> RPC API. You have to either go through the blockchain calculating the balance of the address yourself (i.e. find the last transaction from that address or sum the payouts to the address) or use an online tool like <a href="http://blockchain.info" rel="nofollow">blockchain.info</a> as you mentioned.</p>

CC BY-SA 3.0
2014-10-22T17:12:54.700Z
...or [BlockTrail API](https://www.blocktrail.com/api) or [Chain API](https://chain.com/).
Blockchain.info have been proving to be somewhat unreliable lately, so always good to be aware of the alternatives out there.
OACDesigns
CC BY-SA 3.0
2014-07-23T23:12:13.440Z
2014-07-23T23:12:13.440Z
Jori
<p>I'm a merchant that is currently developing program that I will use for receiving transactions for my business.</p>

<p>I would like my program to be able to check how much Bitcoin the address sending to me has. I have the entire blockchain downloaded to the computer.</p>

<p>Ideally I'd like something that works like this:</p>

<pre><code>String address = "1PSxTeWTVgomscit2BoViZYKSc4QoyrmAk";
Double balance = blockChain.getBalance(address);
</code></pre>

<p>Is this possible? I am having a difficult time finding a way to do this using the blockchain stored on my computer. It seems like it would be fairly easy to do this just using blockchain.info's API, but I would like to keep the process contained on my computer.</p>

<p>Thanks in advance.</p>

CC BY-SA 3.0
2014-08-23T02:02:26.433Z
Addresses do not have balances, so expecting bitcoin core to give you this information is unreasonable.
Guest
CC BY-SA 3.0
2014-10-22T02:50:27.917Z
@Guest While that's technically true, it's a very misleading thing to say.
Nick ODell
<balance><java>
Get address balance in Java
user2980492
# Get address balance in Java

(Asked by: username_0 on 2013-12-02)

I'm a merchant that is currently developing program that I will use for receiving transactions for my business.

I would like my program to be able to check how much Bitcoin the address sending to me has. I have the entire blockchain downloaded to the computer.

Ideally I'd like something that works like this:

```
String address = "1PSxTeWTVgomscit2BoViZYKSc4QoyrmAk";
Double balance = blockChain.getBalance(address);

```

Is this possible? I am having a difficult time finding a way to do this using the blockchain stored on my computer. It seems like it would be fairly easy to do this just using blockchain.info's API, but I would like to keep the process contained on my computer.

Thanks in advance.

**Tags:** balance, java

> **Comments:**
> **username_1**: Addresses do not have balances, so expecting bitcoin core to give you this information is unreasonable.  
> **username_2**: @username_1 While that's technically true, it's a very misleading thing to say.  

---

## 2 answers

### Answer by username_3 on 2017-12-19. Score: 1

If you want to get balance by using address, then you should try :

```
BitcoinJSONRPCClient tr = new BitcoinJSONRPCClient();

tr.gettransaction("txnId");

```

It will give you the Balance and everything related to that particular address.

I hope this will help.


---

### Answer by username_4 on 2014-07-23. Score: 1

If the address is not in your wallet that is not possible with the current `bitcoind` RPC API. You have to either go through the blockchain calculating the balance of the address yourself (i.e. find the last transaction from that address or sum the payouts to the address) or use an online tool like [blockchain.info](http://blockchain.info) as you mentioned.

> **Comments:**
> **username_5**: ...or [BlockTrail API](https://www.blocktrail.com/api) or [Chain API](https://chain.com/). Blockchain.info have been proving to be somewhat unreliable lately, so always good to be aware of the alternatives out there.  

---

