eth_getLogs - Ethereum RPC Method
Query event logs on Ethereum. Essential for indexing DeFi protocols (60% market share), NFT marketplaces, DAOs, and enterprise dApps on the world's leading smart contract platform with the largest developer ecosystem.
Returns an array of all logs matching a given filter object on Ethereum.
Why Ethereum? Build on the world's leading smart contract platform with the largest developer ecosystem with battle-tested security, institutional adoption, and unmatched ecosystem with $166B+ TVL.
Use Cases
The eth_getLogs method is essential for:
- Event indexing - Track contract events for DeFi protocols (60% market share), NFT marketplaces, DAOs, and enterprise dApps
- Token transfers - Monitor ERC20/ERC721 transfers
- DeFi analytics - Track swaps, liquidity events, and more
- Notification systems - Alert on specific on-chain events
Code Examples
Error Handling
| Error Code | Message | Description |
|---|---|---|
| -32005 | Query returned more than 10000 results | Reduce block range |
| -32602 | Invalid params | Invalid filter parameters |
Related Methods
eth_newFilter- Create a filter for logseth_getFilterChanges- Poll filter for new logs
eth_call
Execute smart contract calls without creating transactions on Ethereum. Essential for reading contract state for DeFi protocols (60% market share), NFT marketplaces, DAOs, and enterprise dApps.
eth_newFilter
Create an event log filter on Ethereum. Essential for event monitoring, contract activity tracking, and DeFi event streaming for DeFi protocols (60% market share), NFT marketplaces, DAOs, and enterprise dApps.