net_listening — Polygon JSON-RPC

Status: Available

Returns true if the node is actively listening for p2p network connections.

POSThttps://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
Pass an empty array [] as params.

Response

Response fields

FieldTypeDescription
resultbooleantrue when the node is listening for p2p connections. For a healthy node this is effectively always true.

Errors

CodeMeaningWhen it happens
401trial_expiredThe API key's trial period has ended; upgrade to a paid tier to continue.
403tier_insufficientYour tier is below the level required for this method.
429rate_limitedYou exceeded the requests-per-second limit for your tier. Back off and retry after retry_after_sec.
401subscription_expiredThe subscription tied to this key has lapsed.
401unauthorizedThe API key is missing, malformed, or lacks the polygon_read_rpc scope.
HTTP 403method_unknownThe 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);   // true

Notes

  • The result is a plain boolean, not a hex quantity — no decoding is required.
  • A false result 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_version and net_peerCount.