1

Using Blockchain.info's API, my current approach is to query the endpoint for a block then to collect all the transaction hashes within that block:

https://blockchain.info/rawblock/$block_hash

Then I query the endpoint with each transaction hash to get the details of the transaction:

https://blockchain.info/rawtx/$tx_hash

so I can compute the fees: the difference between the input values and the output values.

The problem is that a block can contain upwards of 2.5k transactions, easily taking me over the call limit for the API. Perhaps there is a more economical way to get all the transaction details in a particular block?

The reason why I want to calculate the fees myself is because most APIs don't take into account Segwit transactions. See this conversation:

https://twitter.com/murchandamus/status/925911487440236552

  • 1
    I'd really recommend using a local bitcoind full node if you're trying to process this much data. It's more secure (since your full node won't lie to you) and scalable (since you're not sending thousands of API requests to a remote third party). – jnewbery Nov 7 '17 at 15:35

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.