I was looking for an API to download block chain data in real-time so I use the transaction data for analytics.
Is anyone aware of a good API for this?
Bitcoin Stack Exchange is a question and answer site for Bitcoin users, developers, and enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI was looking for an API to download block chain data in real-time so I use the transaction data for analytics.
Is anyone aware of a good API for this?
If you are using the bitcoin-qt client https://en.bitcoin.it/wiki/Bitcoin-Qt, you already have the blockchain in your hard drive (in the /bitcoin folder). The files blk000x.dat (blk0001.dat is the first part, blk0002.dat the second ...) contain all the data. blkindex.dat has the index to the blocks.
With the command line version, bitcoind, you can check blocks, transactions. The files can also be studied with bitcointools: https://github.com/gavinandresen/bitcointools
If you are using some other client, the files will be somewhere else, but most likely they will still be there.
Your best bet is to look at something like blockparser to pull data from the existing blockchain, and then using 0.8.2's -blocknotify
option to stay relatively up-to-date.
Remember that there is a trade-off between being real-time and being accurate; you will need to consider if you want a particular number of confirmations before considering a transaction legitimate, or if you want to operate x blocks behind to attempt to avoid issues which might occur if you have blocks which are subsequently orphaned.