How can I find the confirmation information in ethers.js api? I cannot find such kind of function.
The concept of "confirmations" is not native to the blockchain. It's a term used typically to refer to the amount of blocks which are mined on top of the block we're interested in. So if we want to know how many "confirmations" some transaction has we first in which block it was mined in and after that calculate the amount of blocks which were mined after that on top of that block - that's the amount of confirmations.
The term is typically used by exchanges and other parties which need a certain level of certainty for their transactions. With 0 confirmations it's quite likely that a transaction still gets reverted due to the blockchain's consensus mechanism. So typically exchanges require something like 5-10 confirmations before they accept a transaction to be final.
In theory no transaction is ever 100% final and in theory every block in the blockchain may still get reverted. But in reality something like 5 confirmations makes a block already almost 100% certain.