Logs
The Event Log API was designed to provide an alternative to the native eth_getLogs.
Below are the list of supported filter parameters:
  • fromBlock, toBlock, address
  • topic0, topic1, topic2, topic3 (32 Bytes per topic)
  • topic0_1_opr (and|or between topic0 & topic1), topic1_2_opr (and|or between topic1 & topic2), topic2_3_opr (and|or between topic2 & topic3), topic0_2_opr (and|or between topic0 & topic2), topic0_3_opr (and|or between topic0 & topic3), topic1_3_opr (and|or between topic1 & topic3)
Some parameters to take note of
πŸ“
​
  • FromBlock & ToBlock accepts the blocknumber (integer, NOT hex) or 'latest' (earliest & pending is NOT supported yet)
  • Topic Operator (opr) choices are either 'and' or 'or' and are restricted to the above choices only
  • FromBlock & ToBlock parameters are required
  • An address and/or topic(X) parameters are required, when multiple topic(X) parameters are used the topicX_X_opr (and|or operator) is also required
For performance & security considerations, only the first 1000 results are return. So please narrow down the filter parameters.

Sample Log API Queries

Get Event Logs from block number 9201305 to 'latest' , where log address = 0xc715abcd34c8ed9ebbf95990e0c43401fbbc122d and topic[0] = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef

1
https://api-ropsten.etherscan.io/api
2
?module=logs
3
&action=getLogs
4
&fromBlock=9201305
5
&toBlock=latest
6
&address=0xc715abcd34c8ed9ebbf95990e0c43401fbbc122d
7
&topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
8
&apikey=YourApiKeyToken
Copied!
Try this endpoint in your browser
πŸ”—
​

Get Event Logs from block number 11265822 to block 'latest', where log address = 0x8b1a4292e38f3f5e679d2924f3d6e03561f5c83e, topic[0] = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef 'AND' topic[1] = 0x0000000000000000000000001eeb283beebe8e7bcfd357277dd46c793314710d

1
https://api-ropsten.etherscan.io/api
2
?module=logs
3
&action=getLogs
4
&fromBlock=11265822
5
&toBlock=latest
6
&address=0x8b1a4292e38f3f5e679d2924f3d6e03561f5c83e
7
&topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
8
&topic0_1_opr=and
9
&topic1=0x0000000000000000000000001eeb283beebe8e7bcfd357277dd46c793314710d
10
&apikey=YourApiKeyToken
Copied!
Try this endpoint in your browser ​
πŸ”—
​
Last modified 3mo ago
Copy link