getBlocksWithLimit
Returns a list of confirmed blocks starting at the given slot

Parameters

  • <u64> - starting slot integer
  • <u64> - (optional) ending slot integer
  • commitment: (optional) Configures the commitment level of the blocks queried Accepts one of the following strings: ["finalized", "confirmed", "processed"] For more info, refer to this doc.

Results

  • <array of u64 integers>: list of confirmed blocks between the starting and ending slot (if provided) or latest confirmed block, inclusive. Maximum query range allowed is 500,000 slots.

Example

Request

cURL
1
curl --location --request POST 'https://solana-mainnet.g.alchemy.com/v2/demo' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{"jsonrpc": "2.0","id":1,"method":"getBlocksWithLimit","params":[5, 3]}'
Copied!

Response

1
{
2
"jsonrpc": "2.0",
3
"result": [
4
5,
5
6,
6
7
7
],
8
"id": 1
9
}
Copied!