net_peerCount

Returns the number of peers currently connected to the client.

NOTE: This API is effective after Klaytn v1.8.0

📘

Supported on Klaytn (mainnet) only.

Parameters

Request

None

Result

TypeDescription
QUANTITYInteger of the number of connected peers.

API Endpoint

The format of a Klaytn API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/klaytn/

Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/klaytn/

Example

// Request
curl https://open-platform.nodereal.io/{{apiKey}}/klaytn/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":74}' 

// Result
{
    "id":74,
    "jsonrpc": "2.0",
    "result": "0x3" // 2
}