> For the complete documentation index, see [llms.txt](https://sodex.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sodex.com/documentation/for-developers/api-reference/json-rpc/eth-blocknumber.md).

# eth\_blockNumber

POST `https://mainnet.valuechain.xyz`

Returns the number of the current head (`latest`).

This is typically one slot (\~2s) ahead of `safe` and `finalized`. See [Differences from Ethereum](/documentation/for-developers/developers/valuechain-evm/differences-from-ethereum.md#consensus-finality) and [Transaction Finality](/documentation/for-developers/developers/valuechain-evm/transaction-finality.md).

## Parameters

None.

## Result

**Block number** (quantity): Hex-encoded block number of the current head (`latest`).

## Example

### Response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xd81e9f"
}
```

## Code examples

### cURL

```bash
curl --request POST \
  --url https://mainnet.valuechain.xyz \
  --header 'Content-Type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []})
};

fetch('https://mainnet.valuechain.xyz', options)
  .then((res) => res.json())
  .then((res) => console.log(res))
  .catch((err) => console.error(err));
```

### Python

```python
import requests

url = "https://mainnet.valuechain.xyz"
payload = {
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_blockNumber",
  "params": []
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
```
