L0vdL0vd

net_peerCount

Returns the number of peers connected to the node.

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"net_peerCount","params":[]}'

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x40"
}
Params and your endpoint

Parameters

This method takes no parameters.

Returns

string Peer count, hex.

When to use it

See how many peers the node is connected to.

How to read the result

Hex integer: 0x2a = 42 peers.

Tips

  • Behind a load balancer the value comes from whichever node answered.

Related methods