Skip to main content

Parameters

startSlot
number
required
Start slot (inclusive)
limit
number
required
Maximum number of blocks to return
config
object
Configuration object containing the following optional fields:

Response

result
array
Array of block slots in ascending order

Code Examples

Basic Request

Request with Commitment

Using web3.js

Notes

  1. Returns confirmed blocks starting from the specified slot
  2. Results are returned in ascending order
  3. The limit controls the maximum number of blocks to return
  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 limit reasonable to avoid timeouts
  3. Use this method for pagination instead of getBlocks
  4. Cache results when appropriate to reduce RPC load
  5. Handle skipped slots in your application logic

Common Errors

Use Cases

  1. Block Pagination
  2. Recent Block History
  3. Block Streaming