<a href="https://github.com/etclabscore/core-geth/blob/master/internal/ethapi/api.go#L2313" target="_">View on GitHub →</a>
</p>
</details>
---
### net_peerCount
PeerCount returns the number of connected peers
#### Params (0)
_None_
#### Result
<code>hexutil.Uint</code>
+ Required: ✓ Yes
=== "Schema"
``` Schema
- description: `Hex representation of a uint`
- pattern: `^0x([a-fA-F\d])+$`
- title: `uint`
- type: string
```
=== "Raw"
``` Raw
{
"description": "Hex representation of a uint",
"pattern": "^0x([a-fA-F\\d])+$",
"title": "uint",
"type": [
"string"
]
}
```
#### Client Method Invocation Examples
=== "Shell HTTP"
``` shell
curl -X POST -H "Content-Type: application/json" http://localhost:8545 --data '{"jsonrpc": "2.0", "id": 42, "method": "net_peerCount", "params": []}'
```
=== "Shell WebSocket"
``` shell
wscat -c ws://localhost:8546 -x '{"jsonrpc": "2.0", "id": 1, "method": "net_peerCount", "params": []}'
```
=== "Javascript Console"
``` js
net.peerCount();
```
<details><summary>Source code</summary>
<p>
```go
func (s *NetAPI) PeerCount() hexutil.Uint {
return hexutil.Uint(s.net.PeerCount())
}// PeerCount returns the number of connected peers