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

# List batches.

> Retrieves a paginated list of batches.



## OpenAPI

````yaml /openapi-specs/pro-api-v11.yaml get /v2/optimism/batches
openapi: 3.0.0
info:
  contact:
    email: info@blockscout.com
  title: Blockscout
  version: 11.0.3
servers:
  - url: http://localhost/api
    variables: {}
security: []
tags:
  - name: blocks
  - name: transactions
  - name: addresses
  - name: internal-transactions
  - name: tokens
  - name: token-transfers
  - name: smart-contracts
  - name: config
  - name: main-page
  - name: search
  - name: stats
  - name: csv-export
  - name: account-abstraction
  - name: withdrawals
  - name: advanced-filters
  - name: arbitrum
  - name: legacy
  - name: optimism
  - name: mud
  - name: celo
  - name: scroll
  - name: zilliqa
paths:
  /v2/optimism/batches:
    get:
      tags:
        - optimism
      summary: List batches.
      description: Retrieves a paginated list of batches.
      operationId: BlockScoutWeb.API.V2.OptimismController.batches
      parameters:
        - description: API key for rate limiting or for sensitive endpoints
          in: query
          name: apikey
          required: false
          schema:
            type: string
            x-struct: null
            x-validate: null
        - description: Secret key for getting access to restricted resources
          in: query
          name: key
          required: false
          schema:
            type: string
            x-struct: null
            x-validate: null
        - description: ID for paging
          in: query
          name: id
          required: false
          schema:
            type: integer
            x-struct: null
            x-validate: null
        - description: Number of items returned per page
          in: query
          name: items_count
          required: false
          schema:
            maximum: 50
            minimum: 1
            type: integer
            x-struct: null
            x-validate: null
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                nullable: false
                properties:
                  items:
                    items:
                      $ref: '#/components/schemas/Batch'
                    nullable: false
                    type: array
                    x-struct: null
                    x-validate: null
                  next_page_params:
                    example:
                      id: 394591
                      items_count: 50
                    nullable: true
                    type: object
                    x-struct: null
                    x-validate: null
                required:
                  - items
                  - next_page_params
                type: object
                x-struct: null
                x-validate: null
          description: List of batches.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonErrorResponse'
          description: Unprocessable Entity
      callbacks: {}
components:
  schemas:
    Batch:
      additionalProperties: false
      description: Detailed Arbitrum batch info.
      properties:
        after_acc_hash:
          allOf:
            - $ref: '#/components/schemas/FullHash'
          description: >-
            Accumulator hash of the sequencer inbox after this batch was
            appended. Must equal `before_acc_hash` of the next batch.
          x-struct: null
          x-validate: null
        before_acc_hash:
          allOf:
            - $ref: '#/components/schemas/FullHash'
          description: >-
            Accumulator hash of the sequencer inbox before this batch was
            appended. Forms a hash chain: must equal `after_acc_hash` of the
            previous batch.
          x-struct: null
          x-validate: null
        commitment_transaction:
          $ref: '#/components/schemas/CommitmentTransaction'
        data_availability:
          description: >-
            Data availability information. Structure varies by
            `batch_data_container` type.
          oneOf:
            - $ref: '#/components/schemas/Base'
            - $ref: '#/components/schemas/Anytrust'
            - $ref: '#/components/schemas/Celestia'
            - $ref: '#/components/schemas/Eigenda'
          x-struct: null
          x-validate: null
        end_block_number:
          description: Last Rollup block included in the batch.
          minimum: 0
          type: integer
          x-struct: null
          x-validate: null
        number:
          description: Sequential identifier assigned to this batch by the sequencer.
          minimum: 0
          type: integer
          x-struct: null
          x-validate: null
        start_block_number:
          description: First Rollup block included in the batch.
          minimum: 0
          type: integer
          x-struct: null
          x-validate: null
        transactions_count:
          description: Number of transactions in the batch.
          minimum: 0
          type: integer
          x-struct: null
          x-validate: null
      required:
        - number
        - transactions_count
        - start_block_number
        - end_block_number
        - before_acc_hash
        - after_acc_hash
        - commitment_transaction
        - data_availability
      title: Batch
      type: object
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.Arbitrum.Batch
      x-validate: null
    JsonErrorResponse:
      properties:
        errors:
          items:
            properties:
              detail:
                example: null value where string expected
                type: string
                x-struct: null
                x-validate: null
              source:
                properties:
                  pointer:
                    example: /data/attributes/petName
                    type: string
                    x-struct: null
                    x-validate: null
                required:
                  - pointer
                type: object
                x-struct: null
                x-validate: null
              title:
                example: Invalid value
                type: string
                x-struct: null
                x-validate: null
            required:
              - title
              - source
              - detail
            type: object
            x-struct: null
            x-validate: null
          type: array
          x-struct: null
          x-validate: null
      required:
        - errors
      title: JsonErrorResponse
      type: object
      x-struct: Elixir.OpenApiSpex.JsonErrorResponse
      x-validate: null
    FullHash:
      nullable: false
      pattern: ^0x([A-Fa-f0-9]{64})$
      title: FullHash
      type: string
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.General.FullHash
      x-validate: null
    CommitmentTransaction:
      additionalProperties: false
      description: Parent chain transaction that committed the batch.
      properties:
        block_number:
          description: Parent chain block number containing this transaction.
          minimum: 0
          nullable: true
          type: integer
          x-struct: null
          x-validate: null
        hash:
          $ref: '#/components/schemas/FullHashNullable'
        status:
          description: Finalization status of the Parent chain transaction.
          enum:
            - unfinalized
            - finalized
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        timestamp:
          $ref: '#/components/schemas/TimestampNullable'
      required:
        - hash
        - block_number
        - timestamp
        - status
      title: CommitmentTransaction
      type: object
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.Arbitrum.CommitmentTransaction
      x-validate: null
    Base:
      additionalProperties: false
      description: >-
        Data availability info for batches posted via EIP-4844 blobs, calldata,
        or with no DA.
      properties:
        batch_data_container:
          description: Data availability container type.
          enum:
            - in_blob4844
            - in_calldata
          nullable: true
          type: string
          x-struct: null
          x-validate: null
      required:
        - batch_data_container
      title: Base
      type: object
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.Arbitrum.DataAvailability.Base
      x-validate: null
    Anytrust:
      additionalProperties: false
      description: AnyTrust data availability certificate.
      properties:
        batch_data_container:
          enum:
            - in_anytrust
          type: string
          x-struct: null
          x-validate: null
        bls_signature:
          description: Aggregated BLS signature of committee members.
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        data_hash:
          description: AnyTrust data hash.
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        signers:
          description: Committee members who guaranteed data availability.
          items:
            additionalProperties: false
            properties:
              key:
                description: BLS public key.
                type: string
                x-struct: null
                x-validate: null
              proof:
                description: Proof of possession (absent for trusted members).
                type: string
                x-struct: null
                x-validate: null
              trusted:
                description: Whether the signer is a trusted member.
                type: boolean
                x-struct: null
                x-validate: null
            required:
              - trusted
              - key
            type: object
            x-struct: null
            x-validate: null
          type: array
          x-struct: null
          x-validate: null
        timeout:
          description: Data availability timeout (ISO 8601).
          nullable: true
          type: string
          x-struct: null
          x-validate: null
      required:
        - batch_data_container
        - data_hash
        - timeout
        - bls_signature
        - signers
      title: Anytrust
      type: object
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.Arbitrum.DataAvailability.Anytrust
      x-validate: null
    Celestia:
      additionalProperties: false
      description: Celestia data availability blob reference.
      properties:
        batch_data_container:
          enum:
            - in_celestia
          type: string
          x-struct: null
          x-validate: null
        height:
          description: Celestia block height.
          nullable: true
          type: integer
          x-struct: null
          x-validate: null
        transaction_commitment:
          description: Celestia transaction commitment hash.
          nullable: true
          type: string
          x-struct: null
          x-validate: null
      required:
        - batch_data_container
        - height
        - transaction_commitment
      title: Celestia
      type: object
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.Arbitrum.DataAvailability.Celestia
      x-validate: null
    Eigenda:
      additionalProperties: false
      description: EigenDA data availability blob reference.
      properties:
        batch_data_container:
          enum:
            - in_eigenda
          type: string
          x-struct: null
          x-validate: null
        blob_header:
          description: ABI-encoded EigenDA blob header.
          nullable: true
          type: string
          x-struct: null
          x-validate: null
        blob_verification_proof:
          description: ABI-encoded EigenDA blob verification proof.
          nullable: true
          type: string
          x-struct: null
          x-validate: null
      required:
        - batch_data_container
        - blob_header
        - blob_verification_proof
      title: Eigenda
      type: object
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.Arbitrum.DataAvailability.Eigenda
      x-validate: null
    FullHashNullable:
      nullable: true
      pattern: ^0x([A-Fa-f0-9]{64})$
      title: FullHashNullable
      type: string
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.General.FullHashNullable
      x-validate: null
    TimestampNullable:
      format: date-time
      nullable: true
      title: TimestampNullable
      type: string
      x-struct: Elixir.BlockScoutWeb.Schemas.API.V2.General.TimestampNullable
      x-validate: null

````