For the complete documentation index, see llms.txt. This page is also available as Markdown.

eth_getFilterChanges - Polygon

Example code for the eth_getFilterChanges json-rpc method. Сomplete guide on how to use eth_getFilterChanges json-rpc in GetBlock.io Web3 documentation.

The eth_getFilterChanges method polls for logs or changes since the last poll. The filter must have been created with eth_newFilter, eth_newBlockFilter, or eth_newPendingTransactionFilter.

Parameters

Parameter
Type
Required
Description

filterId

string

Yes

The filter ID returned by filter creation methods

Request

cURL
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getFilterChanges",
    "params": ["0x1"],
    "id": "getblock.io"
}'
JavaScript (Axios)
import axios from 'axios';

const url = 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/';

const payload = {
    jsonrpc: '2.0',
    method: 'eth_getFilterChanges',
    params: ["0x1"],
    id: 'getblock.io'
};

axios.post(url, payload, {
    headers: { 'Content-Type': 'application/json' }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": []
}

Response Parameters

Field
Type
Description

jsonrpc

string

JSON-RPC version (2.0)

id

string

Request identifier

result

varies

Array of log objects, block hashes, or transaction hashes depending on filter type

Use Case

The eth_getFilterChanges method is useful for:

  • Event monitoring

  • Real-time updates

  • Log polling

  • Block notifications

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN

-32600

Invalid Request

Malformed request body

-32602

Invalid params

Invalid method parameters

Web3 Integration

Last updated

Was this helpful?