getBlocks
Returns confirmed block slots in the inclusive range starting at startSlot and ending at endSlot, if provided.
Request
{ "jsonrpc": "2.0", "id": 1, "method": "getBlocks", "params": [ 377268280, 377268285, { "commitment": "finalized" } ]}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| startSlot | u64 | Yes | Inclusive start slot for the range of blocks to return. |
| endSlot | u64 | object | No | Inclusive end slot. Must be no more than 500,000 slots higher than startSlot. For backwards compatibility this position may also accept a configuration object (same shape as config) when an end slot is not needed. |
| config | object | No | Configuration object. Only used when endSlot is provided as a number. Contains commitment and optional minContextSlot. |
config fields
The config object is accepted as the third parameter when endSlot is a number, or as the second parameter (in place of endSlot) when no end slot is needed.
| Field | Type | Description |
|---|---|---|
| commitment | string | Commitment level. Accepted values: confirmed, finalized. Defaults to finalized. processed is not supported. |
| minContextSlot | number | Minimum slot at which the request may be evaluated. |
commitment values
| Value | Description |
|---|---|
| confirmed | Return data from the highest slot that at least two-thirds of active stake has directly voted to confirm. More stable than processed, but weaker than finalized. |
| finalized | Return data from the highest slot the cluster recognizes as finalized — at maximum vote lockout, recognized by at least two-thirds of active stake. Strongest commitment level. |
Response
{ "jsonrpc": "2.0", "result": [5, 6, 7, 8, 9, 10], "id": 1}| Field | Type | Description |
|---|---|---|
| result | u64[] | Array of confirmed block slot numbers between startSlot and endSlot (or the highest available slot at the requested commitment), inclusive. Returns an empty array when endSlot is lower than startSlot. Maximum range is 500,000 slots. |
If endSlot is omitted, the range extends to the highest slot available at the requested commitment level. The maximum allowed range is 500,000 slots.