How to get total transactions count by address with infura?

eth_getTransactionCount can only get counts by a block, if I want to get the total transaction count of an address, what should I do?

exp: Lido: stETH Token | Address 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 | Etherscan - https://etherscan.io/address/0xae7ab96520de3a18e5e111b5eaab095312d7fe84

0xae7ab96520de3a18e5e111b5eaab095312d7fe84 → a total of 202,966 transactions

hi @niko_gu if you use the “latest” block tag, you should get the total number of transactions sent by that address to the current state of the chain.
If you want to count all the transactions to and from a contract then you’d need various techniques, there’s not a single json-rpc endpoint to return that info. Check this out go ethereum - Contract's transaction count in a certain period - Ethereum Stack Exchange

1 Like