Skip to main content
POST
eth_getTransactionCount
curl --request POST \
  --url https://tempo-moderato.core.chainstack.com/a25a421add2280d53fdbc23417055501/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionCount",
  "params": [
    "0x9729187D9E8Bbefa8295F39f5634cA454dd9d294",
    "latest"
  ],
  "id": 1
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}
Tempo API method that returns the number of transactions sent from an address (the nonce). This is used to set the correct nonce when sending transactions.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • address — the address to get the transaction count for
  • blockParameter — the block number (hex) or tag (latest, earliest, pending)

Response

  • result — the number of transactions sent from the address encoded as hexadecimal

eth_getTransactionCount code examples

const Web3 = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);

async function getNonce() {
  const nonce = await web3.eth.getTransactionCount("0x9729187D9E8Bbefa8295F39f5634cA454dd9d294");
  console.log(`Nonce: ${nonce}`);
}

getNonce()

Body

application/json
jsonrpc
string
default:2.0
method
string
default:eth_getTransactionCount
params
any[]

Address and block parameter

id
integer
default:1

Response

200 - application/json

The transaction count (nonce)

jsonrpc
string
id
integer
result
string

The number of transactions sent from the address encoded as hexadecimal

Last modified on January 23, 2026