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:
1I'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 – 2017-11-07T15:35:28.603