# getSlotLeaders

> Returns the slot leader for each slot in a forward-looking range.

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

`getSlotLeaders` returns one leader identity per slot, starting at a given slot and running for `limit` slots — the multi-slot version of `getSlotLeader`. It supports planning around leader rotation ahead of time, such as choosing which leader to target next.

- 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: Slots & Epochs
- Availability: All plans

## Parameters

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

- `startSlot` (integer, required): First slot to return a leader for.
- `limit` (integer, required, min 1, max 5000): Number of slots to return leaders for, starting at `startSlot`.

## Result

- `result` (string[], optional): One leader identity per slot in the requested range, in slot order.

## Example: Get leaders for 5 consecutive slots

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

Response:

```json
{
  "jsonrpc": "2.0",
  "result": [
    "BDuvSzKddv74j6m1HCQzjfkipvzYUpXhcg3Jh4mUHero",
    "BDuvSzKddv74j6m1HCQzjfkipvzYUpXhcg3Jh4mUHero",
    "BDuvSzKddv74j6m1HCQzjfkipvzYUpXhcg3Jh4mUHero",
    "BDuvSzKddv74j6m1HCQzjfkipvzYUpXhcg3Jh4mUHero",
    "2y527x7P2qPysm5N2PX19R8Z9Rprmyz9WCDumbyRSpnN"
  ],
  "id": 1
}
```

## Notes

- The same identity repeating for several entries is normal: each leader gets a run of 4 consecutive slots before rotating.
- `startSlot` must be within a range the node can still resolve a schedule for — asking too far past the current epoch boundary returns an error rather than a guess.

