# Ethereum eth_getTransactionCount RPC method

Ethereum API method that returns the number of transactions sent from an address (nonce).

Parameters:

  • address — the address to retrieve the transaction count from.
  • quantity or tag — (optional) the integer block number, or the string with:
    • latest — the latest block that is to be validated. The Beacon Chain may reorg and the latest block can become orphaned.
    • safe — the block that is equal to the tip of the chain and is very unlikely to be orphaned.
    • finalized — the block that is accepted by the two thirds of the Ethereum validators.
    • earliest — the genesis block.
    • pending — the pending state and transactions block.

Returns:

  • result — the integer number of transactions sent from an address.

Example:

Information

cURL needs a HEX String starting with 0x to identify the block if you want to use a hex integer block number as a parameter. For example, block number 14000000 will be 0xD59F80.

  • web3.js
  • web3.py
  • eth.rb
  • cURL
const Web3 = require("web3");
const node_url = "CHAINSTACK_NODE_URL";
const web3 = new Web3(node_url);
web3.eth.getTransactionCount("0xcb8BBFa45541a95C1de883eB3606708cAe9fd45C", "latest", (err, nonce) => {
    console.log(nonce)
})