eth_getFilterLogs - Polygon
eth_getFilterLogs. Retrieve all log entries for a specific filter
eth_getFilterLogs - polygon [Value: 60CU]
Retrieves all past logs for a filter
Use cases
- Retrieve historical logs for a specific filter
- Analyze past events from a created filter
- Audit contract interactions using filter logs
Constraints
- Requires valid filter ID for log retrieval
- Node must support historical log queries
- Accurate filter ID essential for correct log data
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl --request POST \
--url https://polygon.drpc.org \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"params": [
"0x1"
],
"method": "eth_getFilterLogs"
}
'
Response
200
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"address": "0x79c912fef520be002c2b6e57ec4324e260f38e50",
"topics": [
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
"0x000000000000000000000000b94cb72c9b6282b78107a7c8a5eb74de08177935",
"0x0000000000000000000000009c12939390052919af3155f41bf4160fd3666a6f"
],
"data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"blockNumber": "0x45cb8ed",
"transactionHash": "0xa850e378548efda5217e6853fd56cded533d1a61377838abc4ddcc2b13d0acde",
"transactionIndex": "0x0",
"blockHash": "0x60d83df96893805e81eca600a67570cea16481dee40d5e9b210eac215352b714",
"logIndex": "0x0",
"removed": false
}
]
}
Request params
idinteger
jsonrpcstring
methodstring
array of strings
filterIDstring
The ID of the filter for which to retrieve all past logs.
Response
200
An array containing all logs that match the filter criteria, providing historical data relevant to the filter’s configuration.Response params
object
idinteger
jsonrpcstring
resultarray_of_objects
Array of log objects, or an empty array if nothing has changed since last poll.
object
blockHashstring
32-byte hash of the block containing the log, or null if pending.
blockNumberstring
Block number containing the log, or null if pending.
transactionIndexstring
Index position of the transaction that generated the log, or null if pending.
addressstring
20-byte address from which the log originated.
logIndexstring
Index position of the log in the block, or null if pending.
datastring
Non-indexed arguments of the log, in 32-byte segments.
removedboolean
Indicates if the log was removed due to a chain reorganization (true) or is valid (false).
topicsarray_of_strings
Array of zero to four 32-byte data strings of indexed log arguments.
transactionHashstring
Hash of the transaction that generated the log, or null if pending.