TriportRPC

admin_peers

POSThttps://api.triport.io/v1/eth

Returns the set of peers the Ethereum node is currently connected to, with their identity, network, and protocol details.

EthereumBusiness — 20 RPS (with burst)

admin_peers returns an array describing every remote peer the backing Ethereum node is connected to. Each entry carries the peer's enode/enr identity, the negotiated devp2p capabilities, the network endpoints, and the per-protocol handshake state (for example the eth protocol version and the head block the peer advertised).

This method belongs to the eth_peergraph category and is restricted to the Business tier. It is an operational / introspection call — use it to inspect node topology and peer health alongside admin_nodeInfo and admin_datadir, not to serve end-user requests. The data reflects the specific node serving your request, so the peer set and its size will vary between calls and between nodes.

It takes no parameters.

Parameters

This method takes no parameters. Send an empty params array.

optional
No parameters.

Response

Response fields

FieldTypeDescription
jsonrpcstringJSON-RPC protocol version, always "2.0".
idnumber | stringEchoes the request id.
resultarrayList of connected peers. Empty array if the node has no peers.
result[].enodestringThe peer's enode URL (public key + endpoint).
result[].idstringThe peer's node ID (hex public key).
result[].namestringSelf-reported client name and version string.
result[].capsstring[]devp2p capabilities negotiated with the peer (e.g. eth/68, snap/1).
result[].networkobjectConnection details for the peer.
result[].network.localAddressstringLocal host:port of the connection.
result[].network.remoteAddressstringRemote host:port of the connection.
result[].network.inboundbooleantrue if the peer dialed us, false if we dialed it.
result[].network.trustedbooleanWhether the peer is on the node's trusted list.
result[].network.staticbooleanWhether the peer is a configured static peer.
result[].protocolsobjectPer-protocol handshake state, keyed by protocol name.
result[].protocols.eth.versionnumberNegotiated eth protocol version.
result[].protocols.eth.difficultynumber | stringTotal difficulty the peer advertised (0 post-merge).
result[].protocols.eth.headstringHash of the head block the peer advertised.

Errors

CodeMeaningWhen it happens
-32002tier_insufficientYour plan is below the Business tier required for admin_peers. The error data includes current_tier, required_tier, and an upgrade_url.
-32003rate_limitedYou exceeded the 20 RPS limit for this method. The error data includes limit_rps, burst_capacity, and retry_after_sec.
-32005unauthorizedThe API key is missing, malformed, or invalid.

Example error envelope (tier too low):

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32002,
    "message": "tier insufficient for method admin_peers",
    "data": {
      "method": "admin_peers",
      "category": "eth_peergraph",
      "chain": "eth",
      "current_tier": "pro",
      "required_tier": "business",
      "upgrade_url": "https://api.triport.io/upgrade"
    }
  }
}

See errors.md for the full error envelope and the shared error-code reference.

Examples

JavaScript (fetch)

const res = await fetch("https://api.triport.io/v1/eth", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "admin_peers",
    params: [],
  }),
});


const { result } = await res.json();
console.log(`connected peers: ${result.length}`);
for (const peer of result) {
  console.log(peer.id, peer.name, peer.caps);
}

TypeScript SDK (@triport/sdk)

import { Triport } from "@triport/sdk";


const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY });


const peers = await client.eth.request<unknown[]>("admin_peers", []);
console.log(`connected peers: ${peers.length}`);

Python (triport-sdk)

import os
from triport import Triport


client = Triport(api_key=os.environ["TRIPORT_API_KEY"])


peers = client.eth.request("admin_peers", [])
print(f"connected peers: {len(peers)}")
for peer in peers:
    print(peer["id"], peer["name"], peer["caps"])

Notes

  • No parameters and no pagination — the response is the full peer list as a single array. Peer count varies over time and between nodes.
  • Requires the Business tier; a lower tier returns -32002 (tier_insufficient).
  • Related Business-tier admin methods in the same eth_peergraph category: admin_nodeInfo and admin_datadir.
  • Rate limiting is RPS-per-tier with burst; there is no daily quota.