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:
Then I query the endpoint with each transaction hash to get the details of the transaction:
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: