net_listening
https://api.triport.io/v1/ethereumReturns whether the Ethereum node is actively listening for network connections.
net_listening reports whether the underlying Ethereum node is currently
listening for inbound peer-to-peer network connections. It returns a single
boolean: true when the node is accepting connections, false otherwise.
Use it as a lightweight health/liveness probe before issuing heavier calls, or as part of a monitoring loop. It takes no parameters and is available on the free tier, so it is a cheap way to confirm the endpoint is reachable and your API key is valid.
This is a read-only method in the net namespace. It does not reflect peer
count — use net_peerCount for that.
Parameters
This method takes no parameters. Pass an empty array for params.
——optionalResponse
Response fields
| Field | Type | Description |
|---|---|---|
jsonrpc | string | JSON-RPC version, always "2.0". |
id | number | Echoes the request id. |
result | boolean | true if the node is listening for network connections, otherwise false. |
Errors
| Code | Meaning | When it happens |
|---|---|---|
-32001 | trial_expired | The API key's trial period has ended; upgrade the plan to continue. |
-32003 | rate_limited | Requests exceeded the per-tier RPS limit (10 RPS on free). Back off and retry. |
Errors are returned in the standard JSON-RPC error envelope. See the shared Errors page for the full envelope and handling guidance.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/ethereum", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "net_listening",
params: [],
}),
});
const { result } = await res.json();
console.log("listening:", result); // trueTypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const listening: boolean = await triport.ethereum.rpc("net_listening", []);
console.log("listening:", listening);Python (triport-sdk)
import os
from triport import Triport
triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])
listening = triport.ethereum.rpc("net_listening", [])
print("listening:", listening) # TrueNotes
- The result is almost always
truefor a healthy synced node; afalsevalue indicates the node has disabled inbound networking. - For richer connectivity diagnostics, pair this with
net_peerCount(number of connected peers) andnet_version(network ID). - No parameters and no daily quota — rate limiting is purely RPS-per-tier with burst allowance.