eth_getLogs - Polygon RPC Method
Query event logs on Polygon. Essential for indexing enterprise solutions (Starbucks, Disney, Reddit), gaming, DeFi, and stablecoin payments on the most adopted Ethereum scaling solution with 45,000+ dApps and enterprise partnerships.
Returns an array of all logs matching a given filter object on Polygon.
Why Polygon? Build on the most adopted Ethereum scaling solution with 45,000+ dApps and enterprise partnerships with $4B+ TVL, sub-$0.01 transactions, 8M+ daily transactions, and zkEVM for enhanced security.
Use Cases
The eth_getLogs method is essential for:
- Event indexing - Track contract events for enterprise solutions (Starbucks, Disney, Reddit), gaming, DeFi, and stablecoin payments
- 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 Polygon. Essential for reading contract state for enterprise solutions (Starbucks, Disney, Reddit), gaming, DeFi, and stablecoin payments.
eth_newFilter
Create an event log filter on Polygon. Essential for event monitoring, contract activity tracking, and DeFi event streaming for enterprise solutions (Starbucks, Disney, Reddit), gaming, DeFi, and stablecoin payments.