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

# Latest Finalized Block

> Get the latest finalized EVM block number and hash from SQD Portal.



## OpenAPI

````yaml /en/api/catalog/evm/openapi.yaml get /finalized-head
openapi: 3.1.0
info:
  title: SQD Portal API - EVM Dataset Endpoints
  description: >-
    API endpoints for interacting with EVM datasets under the SQD Portal,
    specifically for the Ethereum Mainnet dataset.
  version: 1.0.0
servers:
  - url: https://portal.sqd.dev/datasets/ethereum-mainnet
    description: SQD Portal's endpoint for Ethereum Mainnet
security: []
paths:
  /finalized-head:
    get:
      summary: Latest Finalized Block
      description: >-
        Returns the block number and hash of the highest finalized block
        available in the dataset, or null if no blocks are available. Useful
        mostly for diagnostics, as clients using /stream can get this info from
        the X-Sqd-Finalized-Head-Number and X-Sqd-Finalized-Head-Hash response
        headers.
      responses:
        '200':
          description: Highest finalized block information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlockHead'
              examples:
                ethereum-finalized:
                  summary: Latest finalized Ethereum block
                  value:
                    number: 21499968
                    hash: >-
                      0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
        '404':
          description: Dataset not found (`error.code` is `unknown_dataset`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  type: invalid_request_error
                  code: unknown_dataset
                  message: 'Unknown dataset: no-such-chain'
      x-codeSamples:
        - lang: shell
          label: Get Latest Finalized Ethereum Block
          source: >
            curl --compressed
            'https://portal.sqd.dev/datasets/ethereum-mainnet/finalized-head'
        - lang: python
          label: Get Latest Finalized Ethereum Block
          source: |
            import requests

            response = requests.get(
                "https://portal.sqd.dev/datasets/ethereum-mainnet/finalized-head"
            )
            head = response.json()
        - lang: javascript
          label: Get Latest Finalized Ethereum Block
          source: >
            const response = await
            fetch("https://portal.sqd.dev/datasets/ethereum-mainnet/finalized-head");

            const head = await response.json();
components:
  schemas:
    BlockHead:
      type: object
      properties:
        number:
          type: integer
          format: int64
          description: Block number of the highest available block.
          example: 21500000
        hash:
          type: string
          description: Hash of the highest available block.
          example: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
      nullable: true
    ErrorResponse:
      type: object
      description: Error body shared by every failing response.
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - error
      example:
        error:
          type: invalid_request_error
          code: unknown_dataset
          message: 'Unknown dataset: no-such-chain'
    ErrorDetail:
      type: object
      description: >-
        Machine-readable error detail. Branch on `type`; match on `code` for one
        specific case.
      properties:
        type:
          type: string
          description: >-
            Coarse category to branch on. One of `invalid_request_error`,
            `rate_limit_error`, `availability_error`, or `api_error`. Treat an
            unknown `code` according to its `type`.
          example: invalid_request_error
        code:
          type: string
          description: >-
            Specific cause, stable across releases. Match on this rather than on
            `message`.
          example: base_block_mismatch
        message:
          type: string
          description: >-
            Human-readable detail. Prose, not stable; do not parse or match on
            it.
        param:
          type: string
          description: The request parameter at fault, when the error is about one.
        request_id:
          type: string
          description: >-
            Echo of the `x-request-id` response header, included in the body on
            5xx errors. Quote it when reporting a problem.
      required:
        - type
        - code
        - message

````

## Related topics

- [Latest Finalized Block](/en/api/tron/finalized-head.md)
- [RPC ingestion and reorgs](/en/sdk/squid-sdk/substrate/guides/advanced/unfinalized-blocks.md)
- [Latest Block](/en/api/solana/head.md)
