net_peerCount
Polygon / https://triport.io/polygon
Minimum tier: Free
Last updated:
net_peerCount reports how many p2p peers the underlying Polygon node is
connected to, encoded as a hex-quantity string (e.g. "0x2a" → 42). It is part
of the standard net_* network-info namespace and takes no parameters.
Use it as a lightweight node-health / connectivity signal. The value is most
meaningful on the Bor-consensus backends that serve Polygon mainnet
(chainId 0x89 / 137), where it reflects the node's real Bor p2p peer count.
Gotcha — value reliability: behind some load-balanced / CDN-fronted
infrastructure the peer count is not a real metric. Such backends may return a
fabricated constant or "0x0" regardless of the actual peer topology. Treat a
zero or suspiciously static value as "unknown" rather than "no peers", and do
not build alerting on the absolute number unless you have confirmed your route
serves a direct Bor backend. The count is a coarse signal, not a precise gauge.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
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":"net_peerCount","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": "net_peerCount",
"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":"net_peerCount","params":[]},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Chain: Polygon.
- Clusters: mainnet.
- Credit cost: 1 per call.
FAQ
- What does net_peerCount do?
- Returns the number of peers currently connected to the node's p2p network, as a hexadecimal string.
- How many credits does net_peerCount cost?
- net_peerCount costs 1 credit(s) per call on Triport by default.
- Is net_peerCount available over WebSocket?
- net_peerCount is an HTTP JSON-RPC method.