I have a bitcoin address. How do I get it's balance and the amount of BTC (preferably in Satoshi) it's ever sent and received? I don't want to use any third-party bitcoin services, I want to do it as directly as possible. How can I do that?
If you dont want to use ANY 3rd party service, you will need to parse the entire blobkchain and put it inside a database so you can query whatever information you want.
To do that you have two options:
- code your own parser for blocks/transactions, and here i suggest you using the rcpapi (its all json, nothing crazy) instead of doing it the hard way like this
- use some software which can do it (something like blockexporer or Abe)
Another piece of advice: before you start downloading the blockchain, you need to set this in your bitcoin.conf
# look up historical transactions txindex=1
Which allows you to get detailed information about "old" transactions, but this will make grow the blockchain size in your disk significantly
The standard way to to this is to use software that downloads, parses, and indexes the blockchain. While possible to do create your own software using the bitcoin specification, there are a number of ready-built applications that you can use, such as those listed here: https://bitcoin.org/en/choose-your-wallet. It's going to take a really really long time for the initial download, but once that's done, you'll have access to all the information you're looking for and then some.
In addition, you mention that you would prefer to get the balance in Satoshis? Which ever application you decide to use should give you this option, but just in case that it doesn't, simply take the balance in BTC, and multiply it by 100,000,000.