net_peerCount
BNB Smart Chain / https://triport.io/rpc/bsc
Minimum tier: Free
Last updated:
net_peerCount returns the number of peers connected to the selected BNB Smart Chain node as an EVM hex quantity.
Use it for node-level diagnostics and decode the quantity for display. Because requests may be routed to different eligible nodes, the value is not a stable pool-wide total.
This method reports a count only. net_listening reports the selected node's listening flag, while eth_syncing reports synchronization progress.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| peerCount | Quantity |
Examples
curl https://triport.io/rpc/bsc \
-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/rpc/bsc", {
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/rpc/bsc",
headers={"Authorization": "Bearer <api-key>"},
json={"jsonrpc":"2.0","id":1,"method":"net_peerCount","params":[]},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Chain: BNB Smart Chain.
- Clusters: mainnet.
- Credit cost: 1 per call.
FAQ
- What does net_peerCount do?
- Return the selected node peer count.
- 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.