# getBlocks

> Returns confirmed block slot numbers within a given range, skipping any slots that were never produced.

Source: https://docs.constant-k.com/rpc/http/getblocks/

`getBlocks` lists which slots in a range have a produced block, given a start and optional end slot, letting an indexer walk the chain sequentially without calling `getBlock` on skipped slots.

The range is capped server-side: a large span returns as much as the node allows, not necessarily all of it.

- Transport: HTTP, JSON-RPC 2.0 `POST` to `https://rpc-newyork.constant-k.com/?api-key=YOUR_API_KEY` (New York) or `https://rpc-frankfurt.constant-k.com/?api-key=YOUR_API_KEY` (Frankfurt) or `https://rpc-amsterdam.constant-k.com/?api-key=YOUR_API_KEY` (Amsterdam). The key also works as an `x-api-key` header.
- Category: Blocks
- Availability: Blade Runner and above
- Rate limits: Free not available · Operator not available · Blade Runner 10/s · Nexus 30/s

## Parameters

`params` is a positional JSON array, in this order:

- `startSlot` (integer, required): First slot of the range, inclusive.
- `endSlot` (integer, optional): Last slot of the range, inclusive. Omit to let the node default to `startSlot` plus its maximum allowed range, or the current highest confirmed slot, whichever is smaller.
- `config` (object, optional): Optional configuration.
  - `commitment` (string, optional, one of `confirmed`, `finalized`, default `"finalized"`): Bank state to list blocks from. `processed` is not accepted here.

## Result

- `result` (integer[], optional): Slot numbers of every produced block in the range, ascending. Not wrapped in a context/value envelope.

## Example: List produced slots in an 11-slot window

Request:

```bash
curl "https://rpc-newyork.constant-k.com/?api-key=YOUR_API_KEY" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getBlocks",
    "params": [447946416, 447946426]
  }'
```

Response:

```json
{
  "jsonrpc": "2.0",
  "result": [
    447946416,
    447946417,
    447946418,
    447946419,
    447946420,
    447946421,
    447946422,
    447946423,
    447946424,
    447946425,
    447946426
  ],
  "id": 1
}
```

## Notes

- Skipped slots do not appear in the array; there is no placeholder or marker for them.
- constant-k retains a rolling window of ledger history; a range reaching further back is truncated to what is available, and `minimumLedgerSlot` reports the oldest slot in range.
- Blade Runner and above only — not available on Free or Operator.

