> ## Documentation Index
> Fetch the complete documentation index at: https://chainstack-docs-polygon-erigon-trace-deprecation.mintlify.site/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](/docs/global-elastic-node). See [Solana method limits](/docs/limits#solana-method-limits).
</Note>

# 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 /9de47db917d4f69168e3fed02217d15b
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://nd-326-444-187.p2pify.com
security: []
paths:
  /9de47db917d4f69168e3fed02217d15b:
    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

````