getBlocks

Returns a list of confirmed blocks between two slots.

📘

Supported on Solana (mainnet) only.

Parameters

  • <u64> - start_slot, as u64 integer
  • (optional) <u64> - end_slot, as u64 integer (must be no more than 500,000 blocks higher than the start_slot)
  • (optional) <object> - Configuration object containing the following field:
    • (optional) commitment: <string> - Commitment; "processed" is not supported. If parameter not provided, the default is "finalized".

Returns

The result field will be an array of u64 integers listing confirmed blocks between start_slot and either end_slot, if provided, or latest confirmed block, inclusive. Max range allowed is 500,000 slots.

API Endpoint

The format of an Solana API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/solana/

Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/solana/

Example

Request

curl https://open-platform.nodereal.io/{{apiKey}}/solana/ \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0","id":1,"method":"getBlocks","params":[5, 10]}'

Result

{ "jsonrpc": "2.0", "result": [5, 6, 7, 8, 9, 10], "id": 1 }