TriportRPC

net_version

Polygon / https://triport.io/polygon

Minimum tier: Free

Polygon method guide

Last updated:

net_version returns the network identifier of the connected chain as a decimal string. For Polygon mainnet the value is "137".

This is a legacy companion to eth_chainId: both identify the chain, but net_version returns a decimal string ("137") while eth_chainId returns a hex quantity (0x89). Web3.js versions before 4.x call net_version during network detection, which is the main reason to keep it around. For new integrations prefer eth_chainId — it is the EIP-155 chain ID used for replay-protected transaction signing.

This method takes no parameters and is available on every tier (polygon_read_rpc).

Parameters

This method takes no parameters.

Returns

net_version return value
FieldType
resultobject

Examples

curl https://triport.io/polygon \
  -X POST -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <api-key>' \
  -d '{"jsonrpc":"2.0","id":1,"method":"net_version","params":[]}'
const res = await fetch("https://triport.io/polygon", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
  body: JSON.stringify({
  "jsonrpc": "2.0",
  "id": 1,
  "method": "net_version",
  "params": []
}),
});
const data = await res.json();
import requests
resp = requests.post(
    "https://triport.io/polygon",
    headers={"Authorization": "Bearer <api-key>"},
    json={"jsonrpc":"2.0","id":1,"method":"net_version","params":[]},
)
print(resp.json())

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Chain: Polygon.
  3. Clusters: mainnet.
  4. Credit cost: 1 per call.

FAQ

What does net_version do?
Returns the network ID as a decimal string — "137" for Polygon mainnet.
How many credits does net_version cost?
net_version costs 1 credit(s) per call on Triport by default.
Is net_version available over WebSocket?
net_version is an HTTP JSON-RPC method.