Skip to main content

getFirstAvailableBlock

Returns the slot of the lowest confirmed block that has not been purged from the ledger

Common use cases
Data Pipeline InitializationDetermine the earliest available slot when bootstrapping an indexer, analytics system, or data pipeline to avoid requesting blocks that have been pruned from the ledger.
Block Range ValidationValidate that a target slot or block range falls within the available ledger history before attempting to fetch block data, preventing unnecessary RPC calls.
Ledger Retention MonitoringMonitor cluster retention policies by tracking the first available block over time to understand data availability windows and plan archival strategies.

Parameters

No parameters required.

Request

curl https://solana-mainnet.api.syndica.io/api-key/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getFirstAvailableBlock"
}'
Network Selection

Replace mainnet with devnet in the URL to query devnet instead.

Response

{
"jsonrpc": "2.0",
"result": 250000,
"id": 1
}

Response Fields

Return value: u64

Slot

FAQ and Troubleshooting

What's the difference between getFirstAvailableBlock and minimumLedgerSlot?

Both methods return the oldest slot available on the node, but they query different storage layers. getFirstAvailableBlock queries the long-term storage (BigTable) for the first confirmed block that hasn't been purged, while minimumLedgerSlot queries the validator's local ledger. For RPC nodes with deep historical storage, getFirstAvailableBlock typically returns a much older slot.

Can getFirstAvailableBlock return null?

No. The method returns a u64 slot number. If no blocks are available in storage (which would only occur in catastrophic scenarios), the RPC call would fail rather than return null. In practice, all production RPC nodes have at least some block history available.

minimumLedgerSlot
Returns the oldest slot in the validator's local ledger, complementary to getFirstAvailableBlock which queries long-term storage

getSlot
Returns the most recent slot processed by the node, forming the upper bound of the available block range

getBlock
Fetches detailed block data for a specific slot; use getFirstAvailableBlock to determine valid slot range before calling getBlock

External Resources