I am using web3py to do transactions for token and ether. Now I need to keep a track of transaction fee applied for each transcation. How can I get the transaction fee from transaction hash?
You can get this from the transaction receipt. You can use
It returns a dictionary with the field
gasused, combining this with the
gasPrice that you used for the transaction you can get the fee cost in Ether.
for details of the receipt see the Documentation
Hope this helps