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

> Polygon zkEVM API method that returns information about a specific batch of transactions based on the batch number. zkEVM via Chainstack.

Polygon zkEVM API method that returns information about a specific batch of transactions based on the batch number.

## Parameters

* `batchNumber` — an integer or hexadecimal string representing the batch number.

## Response

* `number` — a hexadecimal value representing the batch number.
* `coinbase` — the address of the sequencer that virtualized this batch, for now, it refers to the Trusted Sequencer address.
* `stateRoot` — the root of the final state of the batch.
* `globalExitRoot` — the root of the tree that represents the deposits of the bridge (multichain). Root containing all the local exit roots of all the connected networks (in this case, a local exit root for L1 and another for L2).
* `localExitRoot` — the root of the tree that represents the deposits of the zkEVM.
* `accInputHash` — the hash of the inputs used to build the zero-knowledge proof for a batch. Also included in the input is the `accInputHash` from the previous batch, used for the aggregation of zero-knowledge proofs.
* `timestamp` — the hexadecimal value of the Unix timestamp representing the exact time of the batch being verified.
* `sendSequencesTxHash` — the hash of the transaction that virtualized this batch. `null` when it's not virtualized yet.
* `verifyBatchTxHash` — the hash of the transaction that verified this batch. `null` when it's not verified yet.
* `transactions[]` — an array of hashes of all the transactions included in the batch.

## `zkevm_getBatchByNumber` 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 getBatchByNumber = async (batchNumber) => {
      const batch = await provider.send("zkevm_getBatchByNumber", [batchNumber]);
      console.log(batch);
  }

  getBatchByNumber(8128);
  ```

  ```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_getBatchByNumber', [8128])
  print(output)
  ```
</CodeGroup>


## OpenAPI

````yaml openapi/polygon_zkevm_node_api/zkevm_methods/zkevm_getBatchByNumber.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_getBatchByNumber
      operationId: zkevm_getBatchByNumber
      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_getBatchByNumber
                params:
                  type: array
                  items:
                    type: string
                  default:
                    - '0x1FC0'
      responses:
        '200':
          description: >-
            Returns information about a specific batch of transactions based on
            the batch number.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object

````