> ## 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.

# zkevm_virtualBatchNumber | zkEVM

> Polygon zkEVM API method that returns the current virtual batch number. In the Polygon zkEVM, transactions are grouped into batches.

Polygon zkEVM API method that returns the current virtual batch number.

In the Polygon zkEVM, transactions are grouped into batches. A virtual batch is a batch that is in the process of being created and has not yet been verified. The virtual batch number represents the next batch to be verified using zero-knowledge proofs.

## Parameters

* `none`

## Response

* `result` — the hexadecimal value of the latest virtual batch number on the Polygon zkEVM network.

## `zkevm_virtualBatchNumber` code examples

<CodeGroup>
  ```jsx ethers.js theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "YOUR_CHAINSTACK_ENDPOINT";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

  const virtualBatchNumber = async () => {

      // This will return the value in Hex
      const currentVirtualBatchNumber = await provider.send("zkevm_virtualBatchNumber");
      console.log(`Current Virtual Batch Number: ${currentVirtualBatchNumber}`);
  };

  virtualBatchNumber();
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3
  node_url = "YOUR_CHAINSTACK_ENDPOINT"
  web3 = Web3(Web3.HTTPProvider(node_url))
  output = web3.provider.make_request('zkevm_virtualBatchNumber', [])
  print(output)
  ```
</CodeGroup>


## OpenAPI

````yaml openapi/polygon_zkevm_node_api/zkevm_methods/zkevm_virtualBatchNumber.json POST /942aad90bb6a082676497030b81e40ba
openapi: 3.0.0
info:
  title: Polygon ZKEVM Node API 5
  version: 1.0.0
  description: This is an API for interacting with a Polygon zkEVM node.
servers:
  - url: https://nd-363-550-219.p2pify.com
security: []
paths:
  /942aad90bb6a082676497030b81e40ba:
    post:
      tags:
        - upload
      summary: zkevm_virtualBatchNumber
      operationId: zkevm_virtualBatchNumber
      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: zkevm_virtualBatchNumber
                params:
                  type: array
                  default: []
      responses:
        '200':
          description: Returns the current virtual batch number.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object

````