Docs

eth_getBlockByNumber - Polygon RPC Method

Retrieve complete block data by block number on Polygon. Perfect for enterprise developers, gaming studios, and teams building high-throughput applications building on the most adopted Ethereum scaling solution with 45,000+ dApps and enterprise partnerships.

Returns information about a block by block number 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_getBlockByNumber method is essential for:

  • Block explorers - Display complete block information
  • Transaction indexers - Process all transactions in a block
  • Analytics platforms - Analyze blockchain data for enterprise solutions (Starbucks, Disney, Reddit), gaming, DeFi, and stablecoin payments
  • Timestamp verification - Get block timestamps for time-based logic

Code Examples

Error Handling

Error CodeMessageDescription
-32602Invalid paramsInvalid block number or parameter format
-32000Block not foundBlock does not exist