eth_blockNumber
Polygon / https://triport.io/polygon
Minimum tier: Free
Last updated:
eth_blockNumber returns the height of the latest block at the tip of the
Polygon chain. The value is a string containing a 0x-prefixed hexadecimal
integer (e.g. "0x3a1f2c0" = 60_815_552). It is the canonical way to discover
the current chain tip before issuing range queries such as eth_getLogs, before
computing confirmation depth for a transaction, or to drive a polling loop that
watches for new blocks.
The method takes no parameters and is available on the free tier under the
polygon_read_rpc scope, making it one of the cheapest calls you can issue. It
reflects the chain tip as seen by the gateway; under normal conditions this is
the canonical head, but during a reorg the returned height can briefly move
backward, so treat any single value as the current best tip rather than a
finalized height.
Polygon produces a block roughly every ~2.1 seconds. A client that needs to track the real-time tip should poll at a sub-block-time interval (e.g. every 1–1.5 s) so it does not miss blocks, while staying within the rps limit of its tier. For event-driven workflows that cannot tolerate polling latency, prefer a subscription-based channel over busy-polling this method.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| blockNumber | string |
Examples
curl https://triport.io/polygon \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'const res = await fetch("https://triport.io/polygon", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "eth_blockNumber",
"params": []
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/polygon",
headers={"Authorization": "Bearer <api-key>"},
json={"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Chain: Polygon.
- Clusters: mainnet.
- Credit cost: 1 per call.
FAQ
- What does eth_blockNumber do?
- Returns the latest Polygon block number as a hex-encoded string.
- How many credits does eth_blockNumber cost?
- eth_blockNumber costs 1 credit(s) per call on Triport by default.
- Is eth_blockNumber available over WebSocket?
- eth_blockNumber is an HTTP JSON-RPC method.