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

# getBlocks

> Возвращает список подтверждённых блоков между двумя слотами.

## Параметры запроса

<ParamField body="slot" type="number" required>
  Начальный слот (обязательно).
</ParamField>

<ParamField body="slot" type="number" required>
  Конечный слот (необязательно; не более 500 000 блоков от начального слота).
</ParamField>

<ParamField body="commitment" type="string" default="finalized">
  Уровень подтверждения для запроса.

  * `confirmed`
  * `finalized`
</ParamField>


## OpenAPI

````yaml ru/openapi/rpc-http/getBlocks.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://mainnet.helius-rpc.com
    description: Конечная точка RPC основной сети
  - url: https://devnet.helius-rpc.com
    description: Конечная точка RPC сети разработки
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getBlocks
      description: Возвращает подтвержденные блоки между начальным и конечным слотами.
      operationId: getBlocks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: Версия протокола JSON-RPC.
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: Уникальный идентификатор запроса.
                  example: '1'
                  default: '1'
                method:
                  type: string
                  enum:
                    - getBlocks
                  description: Имя вызываемого метода RPC.
                  example: getBlocks
                  default: getBlocks
                params:
                  type: array
                  description: Параметры запроса для метода.
                  default:
                    - 5
                    - 10
                    - commitment: finalized
                  items:
                    oneOf:
                      - type: integer
                        description: Начальный слот (обязательно).
                        example: 5
                      - type: integer
                        description: >-
                          Конечный слот (необязательно; должен находиться не
                          более чем в 500 000 блоков от начального слота).
                        example: 10
                      - type: object
                        description: >-
                          Уровень подтверждения показывает, насколько
                          окончательно подтвержден блок на данный момент.
                          Значение "processed" не поддерживается.
                        properties:
                          commitment:
                            type: string
                            description: Уровень подтверждения для запроса.
                            enum:
                              - confirmed
                              - finalized
                            default: finalized
      responses:
        '200':
          description: Подтвержденные блоки успешно получены.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: Идентификатор, соответствующий запросу.
                    example: '1'
                  result:
                    type: array
                    description: Список подтвержденных блоков между start_slot и end_slot.
                    items:
                      type: integer
                    example:
                      - 5
                      - 6
                      - 7
                      - 8
                      - 9
                      - 10
        '400':
          description: >-
            Некорректный запрос — недопустимые параметры или неверный формат
            запроса.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Недопустимые параметры
        '401':
          description: Не авторизовано — ключ API недействителен или отсутствует.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Не авторизовано
                id: '1'
        '429':
          description: Слишком много запросов — превышен лимит запросов.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Слишком много запросов
                id: '1'
        '500':
          description: Внутренняя ошибка сервера — на сервере произошла ошибка.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Внутренняя ошибка
                id: '1'
        '503':
          description: Сервис недоступен — сервис временно недоступен.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Сервис недоступен
                id: '1'
        '504':
          description: Истекло время ожидания шлюза — время ожидания запроса истекло.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Истекло время ожидания шлюза
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
          description: Версия протокола JSON-RPC.
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: Код ошибки.
              example: -32602
            message:
              type: string
              description: Сообщение об ошибке.
              example: Недопустимые параметры
        id:
          type: string
          description: Уникальный идентификатор запроса.
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Ваш ключ API Helius. Вы можете бесплатно получить его в [панели
        управления](https://dashboard.helius.dev/api-keys).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.