⚠️Blast API (blastapi.io) ends Oct 31. Migrate to Dwellir and skip the expensive compute units.
Switch Today →
Skip to main content

eth_blockNumber

Returns the number of the most recent block on Optimism Layer 2.

When to Use This Method

eth_blockNumber is essential for:

  • Synchronization Monitoring - Track if your node is synced
  • Block-based Operations - Get reference point for other RPC calls
  • State Tracking - Monitor blockchain progression
  • Application Polling - Check for new blocks periodically

Parameters

None. This method takes no parameters.

{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}

Returns

QUANTITY - Integer of the current block number.

  • Type: Hexadecimal string
  • Format: 0x prefixed
  • Example: 0x1b4 (436 in decimal)

Implementation Examples

curl -X POST https://api-optimism-mainnet-archive.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'

Response Example

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x75bcd15"
}

This represents block number 123,456,789 in decimal.


Need help? Contact our support team or check the Optimism documentation.