getBlocks - Solana
getBlocks. Retrieves a list of confirmed blocks between two specified slots
getBlocks - solana [Value: 12CU]
Retrieves a list of confirmed blocks between two specified slots
Use cases
- Fetch block range for transaction analysis and validation
- Retrieve multiple blocks to monitor blockchain activity trends
- Analyze historical block data for network
Constraints
- Requires valid block range parameters
- Network latency can affect response times
- Maximum query range allowed is 500,000 slots.
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl --location --request POST 'https://solana.drpc.org' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc": "2.0","id":1,"method":"getBlocks","params":[5, 10]}'
Response
200
{
"id": 0,
"jsonrpc": "string",
"result": [
0
]
}
Request params
idinteger
jsonrpcstring
methodstring
array
start_slotuint64
end_slotuint64
commitmentstring
The level of commitment required for the query
- finalized - The node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized
- confirmed - The node will query the most recent block that has been voted on by supermajority of the cluster
- processed - The node will query its most recent block. Note that the block may not be complete
Response
200
An array of block numbers within the specified slot range that have been confirmedResponse params
array of integers
idinteger
jsonrpcstring
resultarray_of_integers