eth_blockNumber — Ethereum JSON-RPC

Status: Available

Returns the number of the most recent block on the Ethereum chain.

POSThttps://triport.io/eth
Network
Ethereum
Scope
eth_read_rpc
Auth
x-token: $TRIPORT_API_KEY (or Authorization: Bearer)
Rate limit
free 10 RPS sustained · up to 20 burst · basic 20 RPS sustained · up to 40 burst · pro 100 RPS sustained · up to 200 burst · business 250 RPS sustained · up to 500 burst; Burst capacity

Endpoint and plans: Ethereum RPC endpoint.

eth_blockNumber returns the index of the latest block the node has seen, encoded as a 0x-prefixed hexadecimal string. It takes no parameters and is the canonical way to learn the current chain head.

Use it to track chain progress, to pick a concrete latest block height before issuing a batch of historical reads, or as a lightweight liveness/health probe against the RPC endpoint. The value advances roughly once every ~12 seconds on Ethereum mainnet.

Because the result is hex, remember to convert it before using it as a decimal number — e.g. parseInt("0x149e2c1", 16) → 21619905.

Parameters

This method takes no parameters; pass an empty array.

_(none)_arrayrequired
Must be [].

Response

Response fields

FieldTypeDescription
jsonrpcstringJSON-RPC version, always "2.0".
idnumberEchoes the request id.
resultstringLatest block number as a 0x-prefixed hex string (e.g. 0x149e2c1 = 21619905).

Errors

CodeMeaningWhen it happens
401trial_expiredThe account's trial period has ended.
403tier_insufficientThe account's tier does not grant access to this method.
429rate_limitedThe per-tier RPS limit was exceeded. Back off and retry.
401subscription_expiredThe account's paid subscription has lapsed.
401unauthorizedMissing or invalid API key.
HTTP 403method_unknownThe method name is not recognized.

See errors.md for the full error envelope and handling guidance.

Examples

JavaScript (fetch)

const res = await fetch("https://triport.io/eth", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "eth_blockNumber",
    params: [],
  }),
});


const { result } = await res.json();
console.log("latest block:", parseInt(result, 16)); // 21619905

Notes

  • The result is a hex string, not a number — convert with base 16 before arithmetic.
  • eth_blockNumber is available on the Free trial (eth_read_rpc category).
  • Rate limiting is RPS-per-tier with burst; there is no daily quota. An HTTP 429 rate_limited error means you should back off and retry shortly.
  • To fetch the block itself, follow up with eth_getBlockByNumber. To read the current gas price alongside the head, see eth_gasPrice.