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

> 2つのスロット間で承認済みのブロックのリストを返します。

## リクエストパラメータ

<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 ja/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: Devnet 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: >-
        あなたのHelius
        APIキーです。[ダッシュボード](https://dashboard.helius.dev/api-keys)で無料で取得できます。

````