admin_peers
https://api.triport.io/v1/ethReturns the set of peers the Ethereum node is currently connected to, with their identity, network, and protocol details.
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.
——optionalResponse
Response fields
| Field | Type | Description |
|---|---|---|
jsonrpc | string | JSON-RPC protocol version, always "2.0". |
id | number | string | Echoes the request id. |
result | array | List of connected peers. Empty array if the node has no peers. |
result[].enode | string | The peer's enode URL (public key + endpoint). |
result[].id | string | The peer's node ID (hex public key). |
result[].name | string | Self-reported client name and version string. |
result[].caps | string[] | devp2p capabilities negotiated with the peer (e.g. eth/68, snap/1). |
result[].network | object | Connection details for the peer. |
result[].network.localAddress | string | Local host:port of the connection. |
result[].network.remoteAddress | string | Remote host:port of the connection. |
result[].network.inbound | boolean | true if the peer dialed us, false if we dialed it. |
result[].network.trusted | boolean | Whether the peer is on the node's trusted list. |
result[].network.static | boolean | Whether the peer is a configured static peer. |
result[].protocols | object | Per-protocol handshake state, keyed by protocol name. |
result[].protocols.eth.version | number | Negotiated eth protocol version. |
result[].protocols.eth.difficulty | number | string | Total difficulty the peer advertised (0 post-merge). |
result[].protocols.eth.head | string | Hash of the head block the peer advertised. |
Errors
| Code | Meaning | When it happens |
|---|---|---|
-32002 | tier_insufficient | Your plan is below the Business tier required for admin_peers. The error data includes current_tier, required_tier, and an upgrade_url. |
-32003 | rate_limited | You exceeded the 20 RPS limit for this method. The error data includes limit_rps, burst_capacity, and retry_after_sec. |
-32005 | unauthorized | The 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_peergraphcategory: admin_nodeInfo and admin_datadir. - Rate limiting is RPS-per-tier with burst; there is no daily quota.