eth_getTransactionCount
Returns the number of transactions sent from an address.

REQUEST

1
POST https://<network>.infura.io/v3/YOUR-PROJECT-ID
Copied!

HEADERS

1
Content-Type: application/json
Copied!

REQUEST PARAMS

  • ADDRESS [required] - a string representing the address (20 bytes) to check for transaction count for
  • BLOCK PARAMETER [required] - hexadecimal block number, or the string "latest", "earliest" or "pending".

EXAMPLE

1
## JSON-RPC over HTTPS POST
2
## Replace YOUR-PROJECT-ID with a Project ID from your Infura Dashboard
3
## You can also replace mainnet with a different supported network
4
curl https://mainnet.infura.io/v3/YOUR-PROJECT-ID \
5
-X POST \
6
-H "Content-Type: application/json" \
7
-d '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f","0x5bad55"],"id":1}'
8
9
## JSON-RPC over WSS
10
## Replace YOUR-PROJECT-ID with a Project ID from your Infura Dashboard
11
## You can also replace mainnet with a different supported network
12
wscat -c wss://mainnet.infura.io/ws/v3/YOUR-PROJECT-ID
13
>{"jsonrpc":"2.0","method":"eth_getTransactionCount","params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f","0x5bad55"],"id":1}
Copied!

RESPONSE

RESULT FIELDS

  • TRANSACTION COUNT - a hex code of the integer representing the number of transactions sent from this address.

BODY

1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": "0x1a"
5
}
Copied!
Copy link