Skip to main content
POST
/
eth_blockNumber
curl --request POST \
  --url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_blockNumber",
  "params": []
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}
Monad API method that returns the latest block number of the blockchain. A block number is a hexadecimal number representing the block’s position in the blockchain.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • none

Response

  • result — the integer value of the node’s latest block number, encoded as hexadecimal. The block number is used to identify the block’s position in the blockchain and is updated every time a new block is added to the chain.

eth_blockNumber code examples

const { ethers } = require("ethers");

const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");

async function getBlockNumber() {
  const blockNumber = await provider.getBlockNumber();
  console.log(`Latest block: ${blockNumber}`);
}

getBlockNumber();

Use case

A practical use case for eth_blockNumber is tracking the current state of the blockchain. Applications can use the current block number to determine time-sensitive operations, such as calculating when a time-locked contract will become executable or monitoring network progress.

Body

application/json
id
integer
default:1
jsonrpc
string
default:2.0
method
string
default:eth_blockNumber
params
any[]

Response

200 - application/json

The latest block number.

jsonrpc
string
id
integer
result
string