net_version - Ethereum

net_version. Returns the current network id

net_version - ethereum [Value: 0CU]
Returns the current network id.
Use cases

Use cases

  • Determine network version for Ethereum node
  • Validate the connected network version
  • Check network ID for compatibility verification
Constraints

Constraints

  • Requires network access to Ethereum node
  • Node must support net_version method
  • Accurate response depends on node synchronization
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl https://eth.drpc.org \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}'
'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xb1770efb14906e509893b6190359658208ae64d0c56e22f748a1b0869885559e"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
ParametersThis method does not accept any parameters.

Response

200
Returns the current network id.

Response params

object
idinteger
jsonrpcstring
resultstring
The current network id. 1 - Ethereum Mainnet, 2 - Morden Testnet (deprecated), 3 - Ropsten Testnet, 4 - Rinkeby Testnet, 42 - Kovan Testnet.