> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_getTransactionCount | Tempo

> 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.

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.

## 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

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

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

  getNonce();
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3

  node_url = "CHAINSTACK_NODE_URL"
  web3 = Web3(Web3.HTTPProvider(node_url))
  nonce = web3.eth.get_transaction_count("0x9729187D9E8Bbefa8295F39f5634cA454dd9d294")
  print(f"Nonce: {nonce}")
  ```

  ```bash cURL theme={"system"}
  curl -X POST "CHAINSTACK_NODE_URL" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x9729187D9E8Bbefa8295F39f5634cA454dd9d294", "latest"], "id": 1}'
  ```
</CodeGroup>


## OpenAPI

````yaml openapi/tempo_node_api/account_info/eth_getTransactionCount.json POST /
openapi: 3.0.0
info:
  title: eth_getTransactionCount Tempo example
  version: 1.0.0
  description: This is an API example for eth_getTransactionCount for Tempo.
servers:
  - url: https://tempo-mainnet.core.chainstack.com/c3ce2925b51f1ed18719fe8a23bbdccf
security: []
paths:
  /:
    post:
      tags:
        - Account info
      summary: eth_getTransactionCount
      operationId: tempo-eth-getTransactionCount
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getTransactionCount
                params:
                  type: array
                  items: {}
                  default:
                    - '0x9729187D9E8Bbefa8295F39f5634cA454dd9d294'
                    - latest
                  description: Address and block parameter
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: The transaction count (nonce)
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string
                    description: >-
                      The number of transactions sent from the address encoded
                      as hexadecimal

````