getconnectioncount - Bitcoin
getconnectioncount. Returns the number of active peer connections currently established by the node.
getconnectioncount - bitcoin [Value: 0CU]
Returns the number of active connections to other nodes.
Use cases
- Get number of peer connections
- Monitor node's network status
- Check active peer count
Constraints
- Node must be running
- Only counts active connections
- Depends on node's connectivity
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl https://bitcoin.drpc.org \
-X POST \
-H "Content-Type: application/json" \
--data '{ "method": "getconnectioncount" }'
Response
200
{
"jsonrpc": "2.0",
"id": "curltest",
"result": 8
}
Request params
idinteger
jsonrpcstring
methodstring
Response
200
Response params
object
idinteger
jsonrpcstring
resultnumeric
object
nnumeric
The total number of connections to other nodes, both inbound and outbound.
errorstring
The error message, if any.