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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.chainstack.com/feedback

```json
{
  "path": "/reference/fantom-gettransactioncount",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# eth_getTransactionCount | Fantom

Fantom API method that returns the number of transactions sent from an address at the selected block. This value is also called `nonce`; it is an important piece of information, especially to ensure that a transaction is not sent twice.

<Note>
  When called against a block older than the latest \~128 blocks, this method is treated as an archive request (2 RUs instead of 1 RU). See [request units](/docs/request-units#archive-state-methods).
</Note>

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

* `address`— the address to retrieve the transaction count.
* `quantity or tag` — the integer of a block encoded as hexadecimal or the string with:

  * `latest` — the most recent block in the blockchain and the current state of the blockchain at the most recent block. A chain reorganization is to be expected.
  * `safe` — the block that received justification from the beacon chain. Although this block could be involved in a chain reorganization, it would necessitate either a coordinated attack by the majority of validators or an instance of severe propagation latency.
  * `finalized` — the block accepted as canonical by more than 2/3 of the validators. A chain reorganization is extremely unlikely, and it would require at least 1/3 of the staked amount to be burned.
  * `earliest` — the earliest available or genesis block.
  * `pending` — the pending state and transactions block. The current state of transactions that have been broadcast to the network but have not yet been included in a block.

<Note>
  See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block) and [How The Merge Impacts Ethereum’s Application Layer](https://blog.ethereum.org/2021/11/29/how-the-merge-impacts-app-layer).
</Note>

## Response

* `quantity` — an integer value identifying the number of transactions sent from an address at the specified block.

## `eth_getTransactionCount` code examples

<CodeGroup>
  ```javascript web3.js theme={"system"}
  const { Web3 } = require("web3");
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const web3 = new Web3(NODE_URL);

  async function getTransactionsCount(address, blockId) {
    const count = await web3.eth.getTransactionCount(address, blockId)
    console.log(count);
  }

  getTransactionsCount("0x18443ddbc5cd7Fb2F07551b54A37254F06819464", 'latest')
  ```

  ```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 (address, blockId) => {
      const nonce = await provider.send("eth_getTransactionCount", [address, blockId]);
      console.log(nonce);
    };

    getNonce("0x18443ddbc5cd7Fb2F07551b54A37254F06819464", "latest")
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3  
  node_url = "CHAINSTACK_NODE_URL" 

  web3 = Web3(Web3.HTTPProvider(node_url)) 
  print(web3.eth.get_transaction_count("0x18443ddbc5cd7Fb2F07551b54A37254F06819464", "latest")) 
  ```
</CodeGroup>

## Use case

One of the most common use cases for `eth_getTransactionCount`is to create the transaction object built in a script designed to send a transaction. The nonce field is required, and it is retrieved using the `eth_getTransactionCount` method.


## OpenAPI

````yaml /openapi/fantom_node_api/eth_getTransactionCount.json POST /4ab982aa70a7baead515ffdb5915df3f
openapi: 3.0.0
info:
  title: Fantom Node API
  version: 1.0.0
  description: This is an API for interacting with a Fantom node.
servers:
  - url: https://fantom-mainnet.core.chainstack.com
security: []
paths:
  /4ab982aa70a7baead515ffdb5915df3f:
    post:
      tags:
        - upload
      summary: eth_getTransactionCount
      operationId: getTransactionCount
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getTransactionCount
                params:
                  type: array
                  items:
                    anyOf:
                      - type: string
                        title: Address
                        description: The address to check
                      - type: string
                        title: Block identifier
                        description: The block identifier
                  default:
                    - '0x18443ddbc5cd7Fb2F07551b54A37254F06819464'
                    - latest
      responses:
        '200':
          description: The address nonce
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object

````