14

I know blockchain.info has an API: https://blockchain.info/q/addressbalance/134dV6U7gQ6wCFbfHUz2CMh6Dth72oGpgH gets the bitcoin address's balance,but it's not open source and must connect to the Internet.

And I find the open source website blockexplorer.com has not show the right balance: http://blockexplorer.com/testnet/address/134dV6U7gQ6wCFbfHUz2CMh6Dth72oGpgH It gets 0 but not 1250000 from blockchain.info.

I tried bitcoin-qt client debug console: getbalance 134dV6U7gQ6wCFbfHUz2CMh6Dth72oGpgH But it returns 0 whenever the address is not mine.

How can I get someone else's bitcoin address's balance? The bitcoin database is big and hard to check every transaction to get the balance.

Is there any source code or API easy to use?

5
  • 1
    Did you found any method to get else's bitcoin address' balance ? Commented Feb 25, 2014 at 6:04
  • Why does it need to be open source? You'll need to connect to the Internet anyway.
    – jobukkit
    Commented Apr 30, 2014 at 18:59
  • @coding_idiot Not yet. ABE has the function, but I failed to use it. It's too big the database.
    – Gank
    Commented Jun 24, 2014 at 11:20
  • @JopVernooij The website will block my IP, if I quest too much query. :)
    – Gank
    Commented Jun 24, 2014 at 11:21
  • Without internet, you won't be able to get the actual balance. Either you connect to some site or online API, or you use a local Bitcoin client but that will still need internet to get the current data from the Bitcoin p2p network. Commented Nov 10, 2014 at 10:33

1 Answer 1

4

blockexplorer.com does show the right balance. However, you are looking up in the Testnet blockchain.

The right request is the following: http://blockexplorer.com/address/134dV6U7gQ6wCFbfHUz2CMh6Dth72oGpgH

If you open that link, you will see that it shows the right balance.

As you have mentioned, blockexplorer.com is open source, so you probably want to look at the source code to find out how the mechanism you are interested in works.

3
  • Thanks!It works.But it is still difficult to find the getbalance code from blockexplorer.com written in python.Is there an easier way to getbalance locally not by Internet?Just from the bitcoin-qt client?Or any other lib for cpp?
    – Gank
    Commented Dec 19, 2013 at 15:28
  • 1
    bitcoin-qt, as far as I know, doesn't have an API call for this. Commented Dec 20, 2013 at 18:18
  • 1
    where does blockexplorer.com get the information about balances?
    – Incerteza
    Commented Sep 10, 2014 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.