> ## 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_batchNumberByBlockNumber | zkEVM

> Polygon zkEVM API method that returns the batch number associated with a given block number in the zkEVM chain. zkEVM via Chainstack.

Polygon zkEVM API method that returns the batch number associated with a given block number in the zkEVM chain.

In the zkEVM chain, multiple transactions are grouped together and verified as a single batch using zero-knowledge proofs. At the time of writing, the Polygon zkEVM works such that all individual transactions of a particular batch are processed as a separate block so that multiple blocks can be associated with a single batch of transactions.

## Parameters

* `blockNumber` — a hexadecimal string representing a block number in the Polygon zkEVM chain.

## Response

* `result` — a string representing the batch number of the specified block number in the zkEVM chain.

## `zkevm_batchNumberByBlockNumber` 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 batchNumberByBlockNumber = async (blockNumber) => {

      // This will return the value in Hex
   const batchNumber = await provider.send("zkevm_batchNumberByBlockNumber", [blockNumber]);
      console.log(`Batch Number: ${batchNumber}`);
    };

  // replace the hexadecimal block number with the one you want to query
  batchNumberByBlockNumber("0xD65B");
  ```

  ```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_batchNumberByBlockNumber', ["0xD65B"])
  print(output)
  ```
</CodeGroup>


## OpenAPI

````yaml openapi/polygon_zkevm_node_api/zkevm_methods/zkevm_batchNumberByBlockNumber.json POST /942aad90bb6a082676497030b81e40ba
openapi: 3.0.0
info:
  title: Polygon ZKEVM Node API
  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_batchNumberByBlockNumber
      operationId: zkevm_batchNumberByBlockNumber
      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_batchNumberByBlockNumber
                params:
                  type: array
                  items:
                    type: string
                  default:
                    - '0xD65B'
      responses:
        '200':
          description: Returns the batch number associated with the given block number.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object

````