> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# net_version | Arc

> Arc API method that returns the current network ID. Arc Mainnet is 5042 and Arc Testnet is 5042002.

Arc API method that returns the current network ID. Arc Mainnet is `5042` and Arc Testnet is `5042002`. The network ID matches the chain ID on both networks.

## Parameters

* `none`

## Response

* `result` — the network ID as a decimal string (`5042` for Arc Mainnet, `5042002` for Arc Testnet)

## `net_version` code examples

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

  async function getNetworkId() {
    const network = await provider.getNetwork();
    console.log(`Network ID: ${network.chainId}`);
  }

  getNetworkId()
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3

  node_url = "CHAINSTACK_NODE_URL"
  web3 = Web3(Web3.HTTPProvider(node_url))
  print(web3.net.version)
  ```

  ```bash cURL theme={"system"}
  curl -X POST "CHAINSTACK_NODE_URL" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1}'
  ```
</CodeGroup>


## OpenAPI

````yaml openapi/arc_node_api/client_info/net_version.json POST /
openapi: 3.0.0
info:
  title: Chainstack Node API
  version: 1.0.0
  description: This is an API for interacting with a Chainstack node.
servers:
  - url: https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c
security: []
paths:
  /:
    post:
      tags:
        - upload
      summary: net_version
      operationId: net_version
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: net_version
                params:
                  type: array
                  default: []
      responses:
        '200':
          description: Returns the result of net_version.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string
              example:
                jsonrpc: '2.0'
                id: 1
                result: '5042002'

````