---
title: getBlocks
hideTableOfContents: true
h1: getBlocks RPC Method
---

Returns a list of confirmed blocks between two slots

<DocSideBySide>

<DocLeftSide>

### Parameters

<Parameter type={"u64"} required={true}>
  start_slot, as `u64` integer
</Parameter>

<Parameter type={"u64"} optional={true}>
  end_slot, as `u64` integer (must be no more than 500,000 blocks higher than
  the `start_slot`)
</Parameter>

<Parameter type={"object"} optional={true}>

Configuration object containing the following fields:

<Field
  name="commitment"
  type="string"
  optional={true}
  defaultValue={"finalized"}
  href="/docs/rpc/index.mdx#configuring-state-commitment"
>

- "processed" is not supported

</Field>

</Parameter>

### Result

The result field will be an array of u64 integers listing confirmed blocks
between `start_slot` and either `end_slot` - if provided, or latest confirmed
block, inclusive. Max range allowed is 500,000 slots.

</DocLeftSide>

<DocRightSide>

### Code sample

```shell
curl https://api.devnet.solana.com -s -X POST -H "Content-Type: application/json" -d '
  {
    "jsonrpc": "2.0", "id": 1,
    "method": "getBlocks",
    "params": [
      5, 10
    ]
  }
'
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": [5, 6, 7, 8, 9, 10],
  "id": 1
}
```

</DocRightSide>
</DocSideBySide>
