Does the "transaction.get" method give you the block# or height that it was confirmed in within the hex data? If so, then you could just calculate the difference between that number and the current blockchain height and that is your number of confirmations.
NOTE: I see the Address.get_history method returns block heights for the transactions associated with an address... maybe that's an option?
Explain more please,
I do not know how confirmations are counted thanks for giving me an idea