# getBlocksWithLimit

> Returns up to `limit` confirmed block slot numbers starting from a given slot.

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

`getBlocksWithLimit` is `getBlocks` with a count instead of an end slot: it returns up to `limit` produced-block slot numbers starting at `startSlot`, fewer if history runs out.

- 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 to start looking from, inclusive.
- `limit` (integer, required, min 1): Maximum number of produced-block slots to return.
- `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 produced blocks starting at `startSlot`, ascending, capped at `limit` entries. Not wrapped in a context/value envelope.

## Example: Get the next 3 produced blocks from a starting slot

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": "getBlocksWithLimit",
    "params": [447946416, 3]
  }'
```

Response:

```json
{
  "jsonrpc": "2.0",
  "result": [
    447946416,
    447946417,
    447946418
  ],
  "id": 1
}
```

## Notes

- The server also enforces its own upper cap on `limit`; very large requests are clamped, not rejected.
- Blade Runner and above only — not available on Free or Operator, matching `getBlocks`.

