How to get wallet address from transaction details

Hi there,

I’m new to the Solana and trying to develop software to query info from Solana network. My goal is to get the wallet address(payer) from the transaction details.
From Transactions | Solana Docs and the example JSON RPC API | Solana Docs, it seems the 1st pubkey in accountKeys should be the wallet address since it would sign the transaction. However, in the situation of multiple signatures, I don’t know how to differentiate the wallet address. Could you please help me understand when multiple signatures could happen and how we get the wallet from the accountKeys list? Would it still be the 1st in the list? Thank you!