---
title: getFilterChanges
slug: api/getfilterchanges
createdAt: 2022-12-06T18:10:45.000Z
---

{
  "id": "hD-6JmI2OgwhCLKOetaSK",
  "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_getFilterChanges\",\n\t\"params\":[\n\t\t\"0x16\"\n\t],\n\t\"id\":73\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "<p>Polling method for a filter, which returns an array of logs which occurred since last poll.</p>\n<p><strong>Parameters</strong></p>\n<p><code>QUANTITY</code> - the filter id.</p>\n<pre><code>params: [\r\n  \"0x16\" // 22\r\n]\n</code></pre>\n<p><strong>Returns</strong></p>\n<p><code>Array</code> - Array of log objects, or an empty array if nothing has changed since last poll.</p>\n<p>For filters created with <code>eth_newBlockFilter</code> the return are block hashes (<code>DATA</code>, 32 Bytes), e.g. <code>[\"0x3454645634534...\"]</code>.</p>\n<p>For filters created with <code>eth_newPendingTransactionFilter</code> the return are transaction hashes (<code>DATA</code>, 32 Bytes), e.g. <code>[\"0x6345343454645...\"]</code>.</p>\n<p>For filters created with <code>eth_newFilter</code> logs are objects with following params:</p>\n<p><code>removed</code>: <code>TAG</code> - true when the log was removed, due to a chain reorganization. false if its a valid log.</p>\n<p><code>logIndex</code>: <code>QUANTITY</code> - integer of the log index position in the block. <code>null</code> when its pending log.</p>\n<p><code>transactionIndex</code>: <code>QUANTITY</code> - integer of the transactions index position log was created from. <code>null</code> when its pending log.</p>\n<p><code>transactionHash</code>: <code>DATA</code>, 32 Bytes - hash of the transactions this log was created from. <code>null</code> when its pending log.</p>\n<p><code>blockHash</code>: <code>DATA</code>, 32 Bytes - hash of the block where this log was in. <code>null</code> when its pending. <code>null</code> when its pending log.</p>\n<p><code>blockNumber</code>: <code>QUANTITY</code> - the block number where this log was in. <code>null</code> when its pending. <code>null</code> when its pending log.</p>\n<p><code>address</code>: <code>DATA</code>, 20 Bytes - address from which this log originated.</p>\n<p><code>data</code>: <code>DATA</code> - contains one or more 32 Bytes non-indexed arguments of the log.</p>\n<p><code>topics</code>: <code>Array of DATA</code> - Array of 0 to 4 32 Bytes DATA of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. <code>Deposit(address,bytes32,uint256)</code>), except you declared the event with the anonymous specifier.)</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": ""
    }
  ]
}