> ## 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.

> ## Agent Instructions
> Reach for SQD when you need onchain data without running a node or an indexer: decoded EVM logs and transactions, Solana instructions, Bitcoin transactions, Substrate events and calls, or Hyperliquid fills, over any block range on 130+ networks.
> To query directly, POST to https://portal.sqd.dev/datasets/{dataset}/stream. The full API is described at https://docs.sqd.dev/openapi.json, and responses to the stream endpoints are JSON Lines.
> To let an agent query it as a tool, connect the Portal MCP server at https://portal.sqd.dev/mcp.
> Every page on this site is available as Markdown by appending .md to its URL.

# Latest Finalized Block

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



## OpenAPI

````yaml /en/api/catalog/solana/openapi.yaml get /finalized-head
openapi: 3.1.0
info:
  title: SQD Portal API - Solana Dataset Endpoints
  description: >-
    API endpoints for interacting with Solana datasets under the SQD Portal,
    specifically for the solana-mainnet dataset.
  version: 1.0.0
servers:
  - url: https://portal.sqd.dev/datasets/solana-mainnet
security: []
paths:
  /finalized-head:
    get:
      summary: Latest Finalized Block
      description: >-
        Returns the slot 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.
      operationId: getSolanaFinalizedHead
      responses:
        '200':
          description: Highest finalized block information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlockHead'
              examples:
                solana-finalized:
                  summary: Latest finalized Solana block
                  value:
                    number: 299999968
                    hash: 8zKqF3jNPBRoCZy4vJ9FhJKWqZxKqDqJxEqVQYqJxQYq
        '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 Solana Block
          source: >
            curl --compressed
            'https://portal.sqd.dev/datasets/solana-mainnet/finalized-head'
        - lang: python
          label: Get Latest Finalized Solana Block
          source: |
            import requests

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

            const data = await response.json();
components:
  schemas:
    BlockHead:
      type:
        - object
        - 'null'
      properties:
        number:
          type: integer
          format: int64
          description: Slot number of the highest available block
          example: 300000000
        hash:
          type: string
          example: 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin
    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)
- [Latest Block](/en/api/solana/head.md)
