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

# getBlocks | Solana

> The Solana getBlocks method returns a list of confirmed blocks within a specified slot range. Available on Solana via Chainstack JSON-RPC nodes.

> [!NOTE]
>
> **Range limit:** maximum 500,000 blocks per request. **Archive data:** this method supports fetching historical data on [Global Nodes](https://docs.chainstack.com/docs/global-elastic-node.md). See [Solana method limits](https://docs.chainstack.com/docs/limits.md#solana-method-limits).

# Solana `getBlocks` method

The Solana `getBlocks` method returns a list of confirmed blocks within a specified slot range.

This method provides a list of block heights that have been confirmed by the network. It is useful for retrieving a range of blocks for analysis or display.

## Parameters

* `startSlot` — the start slot of the range.
* `endSlot` — (optional) the end slot of the range. If not provided, the method will return all confirmed blocks from the `startSlot` to the latest block.

## Response

* `value` — an array of confirmed block heights within the specified range.

## Use case

A practical use case for `getBlocks` is to retrieve a range of confirmed blocks for analysis or display. This can be useful for block explorers, wallets, or other applications that need to display or make use of this information.


## OpenAPI

````yaml openapi/solana_node_api/getBlocks.json POST /mt_c524ad9781ae5dccd9ac6f5b0370e
openapi: 3.0.0
info:
  title: getBlocks example
  version: 1.0.0
  description: This is an API example for Solana's getBlocks.
servers:
  - url: https://solana-mainnet.core.chainstack.com
security: []
paths:
  /mt_c524ad9781ae5dccd9ac6f5b0370e:
    post:
      tags:
        - query
      summary: getBlocks
      operationId: getBlocks
      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: getBlocks
                params:
                  type: array
                  items:
                    type: integer
                    description: The start slot of the blocks
                    default: 166974442
                  default:
                    - 166974442
      responses:
        '200':
          description: Blocks details
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: array
                    items:
                      type: integer

````