---
title: getProof
slug: api/getproof
createdAt: 2022-12-06T18:10:45.000Z
---

{
  "id": "GDA_ZQ3rjeuI2kmn_xKcP",
  "data": {
    "url": "{{ENVIRONMENT}}",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [],
      "bodyDataParameters": [
        {
          "name": "body",
          "type": "string",
          "example": "{\n    \"jsonrpc\": \"2.0\",\n    \"method\": \"eth_getProof\",\n    \"params\": [\n        \"0a8156e7ee392d885d10eaa86afd0e323afdcd95\",\n        [\n            \"0x0000000000000000000000000000000000000000000000000000000000000347\"\n        ],\n        \"latest\"\n    ],\n    \"id\": 1\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "<p>Returns the account and storage values of the specified account, including the Merkle proof.</p>\n<p>The API allows IoT devices or mobile apps which are unable to run light clients to verify responses<br>\nfrom untrusted sources, by using a trusted block hash.</p>\n<h4>Parameters</h4>\n<p><code>DATA</code> - 20-byte address of the account or contract.</p>\n<p><code>ARRAY</code> - Array of 32-byte storage keys to generate proofs for.</p>\n<p><code>QUANTITY|TAG</code> - Integer representing a block number or one of the string tags <code>latest</code>,<br>\n<code>earliest</code>, or <code>pending</code></p>\n<h4>Returns</h4>\n<p><code>result</code>: <em>Object</em> - Account details:</p>\n<ul>\n<li><code>balance</code>:<code>Quantity</code> - Account balance.</li>\n<li><code>codeHash</code>:<code>Data, 32-byte</code> - Hash of the account code.</li>\n<li><code>nonce</code>:<code>Quantity</code> - Number of transactions sent from the account.</li>\n<li><code>storageHash</code>:<code>Data, 32-byte</code> - SHA3 of the <code>storageRoot</code>.</li>\n<li><code>accountProof</code>:<code>Array</code> - RLP-encoded Merkle tree nodes, starting with the <code>stateRoot</code>.</li>\n<li><code>storageProof</code>:<code>Array</code>- Storage entries. Each entry is an object that displays:\n<ul>\n<li><code>key</code>:<code>Quantity</code> - Storage key.</li>\n<li><code>value</code>:<code>Quantity</code> - Storage value.</li>\n<li><code>proof</code>:<code>Array</code> - RLP-encoded Merkle tree nodes, starting with the <code>storageHash</code>.</li>\n</ul>\n</li>\n</ul>",
    "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": ""
    }
  ]
}