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

Use cases

  • Get number of peer connections
  • Monitor node's network status
  • Check active peer count
Constraints

Constraints

  • Node must be running
  • Only counts active connections
  • Depends on node's connectivity
Get started
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" }'
Copy
Response
200
{
    "jsonrpc": "2.0",
    "id": "curltest",
    "result": 8
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
ParametersThis method does not accept any parameters.

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.