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?

Is it just one address you want info for? Are you saving the transactions for just one address or are you tabulating multiple addresses? More info (including preferred OS, client etc) will help. What is the scope of the project too? Ps what do you define as first party? Eg are you looking at the BitcoinDaemon on an OS and wanting to avoid API?
– Wizard Of OzzieSep 10 '14 at 11:34

@AussieCryptocurrency - the goal is get the info I want using the standard way, not third-party bitcoin services. That's it. Suppose, this is just one or a few arbitrary addresses - doesn't matter.
– アレックスSep 10 '14 at 12:30

The standard way, for most people, is to use third-party services. Bitcoin Core (and AFAIK other popular clients) don't support querying arbitrary addresses other than those that are part of the wallet.
– Nate EldredgeSep 10 '14 at 16:00

@NateEldredge, that can't be a standard way because the third-party services themselves obtain that information from somewhere.
– アレックスSep 10 '14 at 16:53

1

It's all in the public block chain, but the third party services have custom software to parse and index for arbitrary queries. You could write your own, but the standard software doesn't do it and I'm not aware of off-the-shelf solutions. If there are I'd be happy to know.
– Nate EldredgeSep 10 '14 at 17:09

If I put the entire blobkchain into a db, it'll become outdated in a few minutes, won't it? I'll have to constantly update the db.
– アレックスSep 12 '14 at 17:01

Thats why i suggest you using rpcapi: you need to be running a bitcoind somewhere and have a process querying the rcpapi each 10 mins (whatever time you want) and keep your db up-to-date
– reivenSep 12 '14 at 17:04

Sorry, my question was "If I put the entire blobkchain into a db, it'll become outdated in a few minutes, won't it?"
– アレックスSep 12 '14 at 17:29

The answer is yes, but partially. If you keep a proceses checking for new blocks and their respective transactions and putting it into the db, you are ok. Keep in mind that the 6 confirmation needed gives you some time to parse 6 blocks
– reivenSep 12 '14 at 17:36

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.