> ## Documentation Index
> Fetch the complete documentation index at: https://chainstack-docs-polygon-erigon-trace-deprecation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# net_peerCount | Tempo

> Tempo API method that returns the number of peers currently connected to the client. Available on Tempo via Chainstack JSON-RPC nodes.

Tempo API method that returns the number of peers currently connected to the client.

## Parameters

None.

## Response

* `result` — the number of connected peers encoded as hexadecimal

## `net_peerCount` code examples

<CodeGroup>
  ```javascript ethers.js theme={null}
  const ethers = require('ethers');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

  const getPeerCount = async () => {
      const peerCount = await provider.send("net_peerCount", []);
      console.log(`Connected peers: ${parseInt(peerCount, 16)}`);
    };

  getPeerCount();
  ```

  ```python web3.py theme={null}
  from web3 import Web3

  node_url = "CHAINSTACK_NODE_URL"
  web3 = Web3(Web3.HTTPProvider(node_url))

  peer_count = web3.net.peer_count
  print(f"Connected peers: {peer_count}")
  ```

  ```bash cURL theme={null}
  curl -X POST "CHAINSTACK_NODE_URL" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc": "2.0", "method": "net_peerCount", "params": [], "id": 1}'
  ```
</CodeGroup>


## OpenAPI

````yaml openapi/tempo_node_api/client_info/net_peerCount.json POST /
openapi: 3.0.0
info:
  title: net_peerCount Tempo example
  version: 1.0.0
  description: This is an API example for net_peerCount for Tempo.
servers:
  - url: https://tempo-mainnet.core.chainstack.com/c3ce2925b51f1ed18719fe8a23bbdccf
security: []
paths:
  /:
    post:
      tags:
        - Client info
      summary: net_peerCount
      operationId: tempo-net-peerCount
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: net_peerCount
                params:
                  type: array
                  items: {}
                  default: []
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: The peer count
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string
                    description: Number of connected peers encoded as hexadecimal

````