Skip to main content

Parameters

number
required
Start slot (inclusive)
number
required
End slot (inclusive)
object
Configuration object containing the following optional fields:

Response

array
Array of block slots in ascending order

Code Examples

Basic Request

Request with Commitment

Using web3.js

Notes

  1. Returns confirmed blocks between the specified slots
  2. Results are returned in ascending order
  3. The range is inclusive of both start and end slots
  4. Some slots may be skipped (no block produced)
  5. The response is immediate as it reads from the current state

Best Practices

  1. Use appropriate commitment level based on your needs:
    • processed for latest blocks
    • confirmed for high probability finality
    • finalized for guaranteed finality
  2. Keep the slot range reasonable to avoid timeouts
  3. Consider using getBlocksWithLimit for pagination
  4. Cache results when appropriate to reduce RPC load
  5. Handle skipped slots in your application logic

Common Errors

Use Cases

  1. Block Range Analysis
  2. Block History Tracking
  3. Block Gap Detection