net_version
Polygon API - Returns the current network id.

Parameters

none

Returns

String - The current network id.
  • "1": Ethereum Mainnet
  • "2": Morden Testnet (deprecated)
  • "3": Ropsten Testnet
  • "4": Rinkeby Testnet
  • "42": Kovan Testnet

Example

​Alchemy Composer​

The Alchemy Composer allows you to make a no-code example request via your browser. Try it out above!

Request

Curl
Postman
1
curl https://polygon-mainnet.g.alchemyapi.io/v2/your-api-keyy \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-d '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}'
Copied!
1
URL: https://polygon-mainnet.g.alchemyapi.io/v2/your-api-key
2
RequestType: POST
3
Body:
4
{
5
"jsonrpc":"2.0",
6
"method":"net_version",
7
"params":[],
8
"id":67
9
}
Copied!

Result

1
{
2
"jsonrpc": "2.0",
3
"id": 67,
4
"result": "137"
5
}
Copied!
​
Last modified 23d ago