> ## Documentation Index
> Fetch the complete documentation index at: https://goldrush.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# getBlocksWithLimit on Solana

> getBlocksWithLimit returns a list of confirmed blocks starting at a slot, up to a limit on Solana, via GoldRush JSON-RPC.

> [card] 0.05 credits per call

`getBlocksWithLimit` on **Solana**: Returns a list of confirmed blocks starting at a slot, up to a limit.

## Endpoint

```
https://rpc.goldrushdata.com/v1/solana-mainnet
```

Authenticate with `Authorization: Bearer <GOLDRUSH_API_KEY>`. See [authentication](https://goldrush.dev/docs/goldrush-json-rpc/authentication.md).

## Parameters

| Name | Type | Required | Description | Example |
| - | - | - | - | - |
| `startSlot` | `u64` | yes | First slot to include (inclusive). | `372877000` |
| `limit` | `u64` | yes | Maximum number of blocks to return (must be no greater than 500,000). | `5` |
| `config` | `object` | no | `{commitment?}`. `processed` is not supported. | `{"commitment":"finalized"}` |

## Returns

`array<u64>`: Array of confirmed block slots in ascending order.

```json theme={null}
[372877000, 372877001, 372877003, 372877004, 372877005]
```

## Examples

```bash curl theme={null}
curl https://rpc.goldrushdata.com/v1/solana-mainnet \
  -H "Authorization: Bearer $GOLDRUSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getBlocksWithLimit",
    "params": [372877000, 5, {"commitment":"finalized"}]
  }'
```

```typescript @solana/kit theme={null}
import {
  createDefaultRpcTransport,
  createSolanaRpcFromTransport,
} from "@solana/kit";

const transport = createDefaultRpcTransport({
  url: "https://rpc.goldrushdata.com/v1/solana-mainnet",
  headers: { Authorization: `Bearer ${process.env.GOLDRUSH_API_KEY}` },
});
const rpc = createSolanaRpcFromTransport(transport);

const result = await rpc.getBlocksWithLimit(372877000, 5, {"commitment":"finalized"}).send();
console.log(result);
```

```python python theme={null}
import os
import requests

resp = requests.post(
    "https://rpc.goldrushdata.com/v1/solana-mainnet",
    headers={
        "Authorization": f"Bearer {os.environ['GOLDRUSH_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={"jsonrpc": "2.0", "id": 1, "method": "getBlocksWithLimit", "params": [372877000, 5, {"commitment":"finalized"}]},
)
print(resp.json()["result"])
```

## Errors

Standard JSON-RPC errors: `-32600` invalid request, `-32601` method not found, `-32602` invalid params.

## Related Blocks info methods on Solana

* [`getBlock` on Solana](https://goldrush.dev/docs/api-reference/json-rpc/solana/getblock)
* [`getBlocks` on Solana](https://goldrush.dev/docs/api-reference/json-rpc/solana/getblocks)
* [`getBlockHeight` on Solana](https://goldrush.dev/docs/api-reference/json-rpc/solana/getblockheight)
* [`getBlockTime` on Solana](https://goldrush.dev/docs/api-reference/json-rpc/solana/getblocktime)
* [`getBlockProduction` on Solana](https://goldrush.dev/docs/api-reference/json-rpc/solana/getblockproduction)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.