eth_getFilterLogs - BSC

Example code for the eth_getFilterLogs JSON RPC method. Сomplete guide on how to use eth_getFilterLogs JSON RPC in GetBlock Web3 documentation.

The eth_getFilterLogs method returns an array of all logs matching a filter with the given ID on the BNB Smart Chain.

Parameters

Parameter
Type
Required
Description

filterId

string

Yes

Filter ID from eth_newFilter

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getFilterLogs",
    "params": ["0x1"],
    "id": "getblock.io"
}'

Response Example

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

Response Parameters

Parameter
Type
Description

result

array

Array of log objects matching the filter

Use Cases

  • Retrieve all logs from a filter

  • Batch process events

  • Historical event analysis

Error Handling

Error Code
Description

-32602

Invalid filter ID

-32603

Internal error

SDK Integration

Last updated

Was this helpful?