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

> Gibt eine Liste bestätigter Blöcke zwischen zwei Slots zurück.

## Anforderungsparameter

<ParamField body="slot" type="number" required>
  Startslot (erforderlich).
</ParamField>

<ParamField body="slot" type="number" required>
  Endslot (optional, muss ≤ 500.000 Blöcke vom Startslot sein).
</ParamField>

<ParamField body="commitment" type="string" default="finalized">
  Das Commitment-Level für die Anfrage.

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


## OpenAPI

````yaml de/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: Mainnet-RPC-Endpunkt
  - url: https://devnet.helius-rpc.com
    description: Devnet-RPC-Endpunkt
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getBlocks
      description: Gibt bestätigte Blöcke zwischen einem Start- und End-Slot zurück.
      operationId: getBlocks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: Die JSON-RPC-Protokollversion.
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: Eine eindeutige Kennung für die Anfrage.
                  example: '1'
                  default: '1'
                method:
                  type: string
                  enum:
                    - getBlocks
                  description: Der Name der RPC-Methode, die aufgerufen werden soll.
                  example: getBlocks
                  default: getBlocks
                params:
                  type: array
                  description: Anfrageparameter für die Methode.
                  default:
                    - 5
                    - 10
                    - commitment: finalized
                  items:
                    oneOf:
                      - type: integer
                        description: Start-Slot (erforderlich).
                        example: 5
                      - type: integer
                        description: >-
                          End-Slot (optional, muss ≤ 500.000 Blöcke vom
                          Start-Slot entfernt sein).
                        example: 10
                      - type: object
                        description: >-
                          Das Commitment beschreibt, wie finalisiert ein Block
                          zu diesem Zeitpunkt ist. "processed" wird nicht
                          unterstützt.
                        properties:
                          commitment:
                            type: string
                            description: Das Commitment-Level für die Anfrage.
                            enum:
                              - confirmed
                              - finalized
                            default: finalized
      responses:
        '200':
          description: Erfolgreich bestätigte Blöcke abgerufen.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: Kennung, die mit der Anfrage übereinstimmt.
                    example: '1'
                  result:
                    type: array
                    description: >-
                      Liste der bestätigten Blöcke zwischen start_slot und
                      end_slot.
                    items:
                      type: integer
                    example:
                      - 5
                      - 6
                      - 7
                      - 8
                      - 9
                      - 10
        '400':
          description: >-
            Fehlerhafte Anfrage - Ungültige Anfrageparameter oder fehlerhafte
            Anfrage.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Ungültige Parameter
        '401':
          description: Nicht autorisiert - Ungültiger oder fehlender API-Schlüssel.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Nicht autorisiert
                id: '1'
        '429':
          description: Zu viele Anfragen - Ratenlimit überschritten.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Zu viele Anfragen
                id: '1'
        '500':
          description: Interner Serverfehler - Ein Fehler ist auf dem Server aufgetreten.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Interner Fehler
                id: '1'
        '503':
          description: >-
            Dienst nicht verfügbar - Der Dienst ist vorübergehend nicht
            verfügbar.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Dienst nicht verfügbar
                id: '1'
        '504':
          description: Gateway-Zeitüberschreitung - Die Anfrage ist abgelaufen.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Gateway-Zeitüberschreitung
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
          description: Die JSON-RPC-Protokollversion.
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: Der Fehlercode.
              example: -32602
            message:
              type: string
              description: Die Fehlermeldung.
              example: Ungültige Parameter
        id:
          type: string
          description: Eine eindeutige Kennung für die Anfrage.
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Ihr Helius-API-Schlüssel. Sie können einen kostenlos im
        [Dashboard](https://dashboard.helius.dev/api-keys) erhalten.

````