net_listening — Polygon JSON-RPC
Returns true if the node is actively listening for p2p network connections.
https://triport.io/polygon- Network
- Polygon
- Scope
- polygon_read_rpc
- Auth
- x-token: $TRIPORT_API_KEY (or Authorization: Bearer)
- Rate limit
- free — 15 RPS sustained · up to 30 burst · basic — 20 RPS sustained · up to 40 burst · pro — 100 RPS sustained · up to 200 burst · business — 250 RPS sustained · up to 500 burst; Burst capacity
Endpoint and plans: Polygon RPC endpoint.
net_listening reports whether the underlying Polygon node is currently
listening for inbound peer-to-peer connections. The result is a single boolean.
In practice a healthy, production node always returns true, so the method is
most useful as a lightweight liveness check rather than a source of changing
state. It takes no parameters and is available on the Free trial.
If you need richer network information, pair this with
net_peerCount (number of connected peers) and
net_version (the network ID as a decimal string).
Parameters
This method takes no parameters.
——optional[] as params.Response
Response fields
| Field | Type | Description |
|---|---|---|
result | boolean | true when the node is listening for p2p connections. For a healthy node this is effectively always true. |
Errors
| Code | Meaning | When it happens |
|---|---|---|
401 | trial_expired | The API key's trial period has ended; upgrade to a paid tier to continue. |
403 | tier_insufficient | Your tier is below the level required for this method. |
429 | rate_limited | You exceeded the requests-per-second limit for your tier. Back off and retry after retry_after_sec. |
401 | subscription_expired | The subscription tied to this key has lapsed. |
401 | unauthorized | The API key is missing, malformed, or lacks the polygon_read_rpc scope. |
HTTP 403 | method_unknown | The method name is not recognized on this network. |
Errors are returned in the standard JSON-RPC envelope. See the shared errors reference for the full error object shape and handling guidance.
Examples
JavaScript (fetch)
const res = await fetch("https://triport.io/polygon", {
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(result); // trueNotes
- The result is a plain boolean, not a hex quantity — no decoding is required.
- A
falseresult from a healthy production endpoint is not expected; treat it as a signal that the node is degraded rather than as routine state. - Because the value rarely changes, there is little benefit to polling it at high frequency. Use it as an occasional health-ping, not a per-request gate.
- Related network-info methods:
net_versionandnet_peerCount.