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

# Block

> Provides comprehensive details about a specific execution layer block, excluding rewards. For reward details, refer to [v2/ethereum/block/rewards](/api-reference/ethereum/block/rewards).

Execution layer blocks contain transactions and state changes, while consensus layer slots manage validator duties and finality. Since the Merge (Proof-of-Stake transition), each execution layer block corresponds to a consensus layer slot, though their numbers differ.

This endpoint delivers an overview of the requested block, including its slot reference (if applicable), block hash, timestamp, gas usage, transaction counts, and other key metrics. For pre-Merge blocks, consensus layer references will be null.

Query options include block number or keywords like "latest" and "finalized" for the most recent or finalized block.




## OpenAPI

````yaml /v3/bundled.yaml post /api/v2/ethereum/block
openapi: 3.0.4
info:
  title: External Service API
  version: 1.0.3
servers:
  - url: https://beaconcha.in
    description: Production API
security:
  - ApiKeyAuth: []
paths:
  /api/v2/ethereum/block:
    post:
      tags:
        - Block
      summary: Block
      description: >
        Provides comprehensive details about a specific execution layer block,
        excluding rewards. For reward details, refer to
        [v2/ethereum/block/rewards](/api-reference/ethereum/block/rewards).


        Execution layer blocks contain transactions and state changes, while
        consensus layer slots manage validator duties and finality. Since the
        Merge (Proof-of-Stake transition), each execution layer block
        corresponds to a consensus layer slot, though their numbers differ.


        This endpoint delivers an overview of the requested block, including its
        slot reference (if applicable), block hash, timestamp, gas usage,
        transaction counts, and other key metrics. For pre-Merge blocks,
        consensus layer references will be null.


        Query options include block number or keywords like "latest" and
        "finalized" for the most recent or finalized block.
      operationId: GetBlockOverview
      requestBody:
        $ref: '#/components/requestBodies/BlockAndChain'
      responses:
        '200':
          $ref: '#/components/responses/BlockOverview'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/DefaultError'
components:
  requestBodies:
    BlockAndChain:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/NamedChain'
              - $ref: '#/components/schemas/NamedBlockSelector'
            required:
              - block
          example:
            block:
              view: latest
            chain: mainnet
  responses:
    BlockOverview:
      description: Successful response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BlockOverview.Container'
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Bad request. Please check your input and try again.
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized. Please provide a valid API key.
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: >-
              endpoint not allowed for your subscription tier. upgrade your
              subscription at https://beaconcha.in/pricing.
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: The requested resource was not found.
    MethodNotAllowed:
      description: Method Not Allowed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'method not allowed: GET. all public API endpoints use POST.'
    RateLimitExceeded:
      description: Rate Limit Exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Rate limit exceeded. Please try again later.
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: internal server error. please try again later.
    DefaultError:
      description: An unexpected error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: An unexpected error occurred.
  schemas:
    NamedChain:
      type: object
      properties:
        chain:
          $ref: '#/components/schemas/Chain'
    NamedBlockSelector:
      type: object
      properties:
        block:
          $ref: '#/components/schemas/BlockSelector'
      required:
        - block
    BlockOverview.Container:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/BlockOverview.Data'
      description: Response containing basic information about the block.
      required:
        - data
    Error:
      type: object
      properties:
        error:
          type: string
    Chain:
      type: string
      enum:
        - mainnet
        - hoodi
      default: mainnet
      description: The Ethereum chain to query.
    BlockSelector:
      description: |
        Specify a block using one of the following methods.
        - Block number
        - View: "latest" or "finalized" 
      oneOf:
        - $ref: '#/components/schemas/BlockByNumber'
        - $ref: '#/components/schemas/BlockByChainView'
      default: latest
    BlockOverview.Data:
      type: object
      properties:
        block:
          $ref: '#/components/schemas/Block'
        timestamp:
          $ref: '#/components/schemas/timestamp'
        consensus_reference:
          $ref: '#/components/schemas/ConsensusLayerReference'
          nullable: true
        hash:
          $ref: '#/components/schemas/ExecutionLayerBlockHash'
        parent_hash:
          $ref: '#/components/schemas/ExecutionLayerBlockHash'
        receipts_root:
          $ref: '#/components/schemas/Hash'
        state_root:
          $ref: '#/components/schemas/Hash'
        transaction:
          $ref: '#/components/schemas/BlockOverview.Transaction'
        blob:
          $ref: '#/components/schemas/BlockOverview.Blob'
        mining:
          $ref: '#/components/schemas/BlockOverview.Mining'
        extra_data:
          type: string
          description: Extra data field of the block. Represented in hex-decimal format.
        finality:
          $ref: '#/components/schemas/FinalityParams'
      required:
        - block
        - timestamp
        - hash
        - transaction
        - parent_hash
        - receipts_root
        - state_root
        - extra_data
        - finality
    BlockByNumber:
      title: Number
      type: object
      properties:
        number:
          $ref: '#/components/schemas/Block'
      required:
        - number
    BlockByChainView:
      title: View
      type: object
      properties:
        view:
          $ref: '#/components/schemas/ChainView'
      required:
        - view
    Block:
      type: integer
      minimum: 0
      description: Block by number.
    timestamp:
      type: integer
      minimum: 0
    ConsensusLayerReference:
      type: object
      description: |
        Reference to a consensus layer block if one exists for the given slot.
        This will be null for the PoW era.
      nullable: true
      properties:
        slot:
          $ref: '#/components/schemas/Slot'
        block_root:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ConsensusLayerBlockRoot'
        epoch:
          $ref: '#/components/schemas/Epoch'
      required:
        - slot
        - epoch
    ExecutionLayerBlockHash:
      type: string
      pattern: ^0x[a-fA-F0-9]{64}$
      description: A 32-byte block hash represented as a hex string with 0x prefix.
    Hash:
      type: string
      pattern: ^0x[a-fA-F0-9]{64}$
    BlockOverview.Transaction:
      type: object
      properties:
        gas:
          $ref: '#/components/schemas/BlockOverview.Gas'
        count:
          $ref: '#/components/schemas/BlockOverview.TransactionCount'
      required:
        - gas
        - count
    BlockOverview.Blob:
      type: object
      nullable: true
      properties:
        gas:
          $ref: '#/components/schemas/BlockOverview.BlobGas'
      required:
        - gas
    BlockOverview.Mining:
      type: object
      nullable: true
      description: |
        Details specific to proof-of-work era blocks prior to the Merge.

        Will be null for proof-of-stake era blocks after the Merge.
      properties:
        miner:
          $ref: '#/components/schemas/ExecutionLayerAddressDetails'
        difficulty:
          type: string
          description: Difficulty of mining this block. Represented in decimal format.
        mix_hash:
          $ref: '#/components/schemas/Hash'
        uncles_sha3:
          $ref: '#/components/schemas/Hash'
        uncles_count:
          type: integer
      required:
        - miner
        - difficulty
        - mix_hash
        - uncles_sha3
        - uncles_count
    FinalityParams:
      type: string
      description: |
        Indicates the finality status of the data provided. 
          - Finalized data cannot be changed without slashing at least one-third of all validators, providing strong economic guarantees.
          - Data marked as not_finalized does not have this guarantee and may still change.
      enum:
        - not_finalized
        - finalized
    ChainView:
      type: string
      enum:
        - latest
        - finalized
      description: >
        - "latest": Refers to the most recent block, which may be subject to
        reorganization.

        - "finalized": Refers to the latest block that has been finalized and is
        not subject to change.
    Slot:
      type: integer
      minimum: 0
      description: Slot by number.
    ConsensusLayerBlockRoot:
      type: string
      pattern: ^0x[a-fA-F0-9]{64}$
      description: A 32-byte block root represented as a hex string with 0x prefix.
    Epoch:
      type: integer
      minimum: 0
    BlockOverview.Gas:
      type: object
      properties:
        used:
          type: integer
          description: Total gas used in this block.
        limit:
          type: integer
          description: Gas limit for this block.
        base_fee:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/wei'
          description: >-
            Base fee per gas unit for this block in wei. Will be null for blocks
            prior to EIP-1559.
        fees_burned:
          allOf:
            - $ref: '#/components/schemas/wei'
          nullable: true
          description: >-
            Total fees burned in this block in wei according to EIP-1559. Will
            be null for blocks prior to EIP-1559.
      required:
        - used
        - limit
    BlockOverview.TransactionCount:
      type: object
      properties:
        normal:
          type: integer
          description: >-
            Number of non-internal and non-blob transactions included in this
            block.
        blob:
          type: integer
          nullable: true
          description: >
            Number of blob transactions included in this block, if any.


            Blob transactions are introduced by EIP-4844 (Proto-Danksharding) as
            part of the data availability layer in the Pectra hardfork.

            This field is null for blocks prior to the hardfork activation.
        internal:
          type: integer
          description: >-
            Number of internal transactions (value transfers within smart
            contracts) in this block.
      required:
        - normal
        - internal
    BlockOverview.BlobGas:
      type: object
      description: >
        Details about blob gas usage in this block, if any.


        Data blobs are introduced by EIP-4844 (Proto-Danksharding) as part of
        the data availability layer in the Pectra hardfork.

        This field is null for blocks prior to the hardfork activation.
      properties:
        used:
          type: integer
          description: Total blob gas used in this block.
        excess:
          type: integer
          description: >
            Represents the cumulative excess blob gas consumed relative to the
            target, up to the current block. 

            When a block exceeds the target blob gas consumption, this value
            increases. Conversely, when a block consumes less than the target,
            this value decreases, but it is always bounded at a minimum of 0.


            See: https://eips.ethereum.org/EIPS/eip-4844#gas-accounting
      required:
        - used
        - excess
    ExecutionLayerAddressDetails:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/ExecutionLayerAddress'
        is_contract:
          type: boolean
      required:
        - address
        - is_contract
    wei:
      type: string
      description: Amount in wei (1 ETH = 10^18 wei)
      pattern: ^(0|-?[1-9][0-9]*)$
    ExecutionLayerAddress:
      type: string
      pattern: ^0x[a-fA-F0-9]{40}$
      description: A standard Ethereum address (20-byte hex string with 0x prefix).
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Authorization header with value: Bearer YOUR_TOKEN. Refer to the [API
        Keys](/api/overview#api-keys) section to create your API key.

````