---
title: getTransactionCount
slug: api/gettransactioncount
createdAt: 2022-12-06T18:10:45.000Z
---

{
  "id": "twvHVep62Q_dF8C_gN8fq",
  "data": {
    "url": "{{ENVIRONMENT}}",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "Content-Type",
          "type": "string",
          "example": "application/json",
          "description": ""
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "type": "string",
          "example": "{\n\t\"jsonrpc\":\"2.0\",\n\t\"method\":\"eth_getTransactionCount\",\n\t\"params\":[\n\t\t\"0x407d73d8a49eeb85d32cf465507dd71d507100c1\",\n\t\t\"latest\"\n\t],\n\t\"id\":1\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "<p>Returns the number of transactions sent from an address.</p>\n<p><strong>Parameters</strong></p>\n<p><code>DATA</code>, 20 Bytes - address.</p>\n<p><code>QUANTITY|TAG</code> - integer block number, or the string <code>\"latest\"</code>, <code>\"earliest\"</code> or <code>\"pending\"</code>, see the default block parameter</p>\n<pre><code>params: [\r\n   '0x407d73d8a49eeb85d32cf465507dd71d507100c1',\r\n   'latest' // state at the latest block\r\n]\n</code></pre>\n<p><strong>Returns</strong></p>\n<p><code>QUANTITY</code> - integer of the number of transactions send from this address.</p>",
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{ENVIRONMENT}} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{ENVIRONMENT}}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{ENVIRONMENT}}\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{ENVIRONMENT}}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": ""
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}