---
title: getFirstAvailableBlock
description: >-
  Returns the lowest confirmed block slot still available in this node's ledger.
url: /docs/rpc/http/getfirstavailableblock
type: reference
hideTableOfContents: true
---

Returns the lowest confirmed block slot still available in this node's ledger.

<Callout type="info" title="Source">
  [`get_first_available_block`](https://github.com/anza-xyz/agave/blob/v3.1.8/rpc/src/rpc.rs#L1939)
</Callout>

<APIMethod>

```jsonc !!request curl
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getFirstAvailableBlock"
}
```

```ts !!request title="Kit"
import { createSolanaRpc } from "@solana/kit";

const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);

let firstAvailableBlock = await rpc.getFirstAvailableBlock().send();

console.log(firstAvailableBlock);
```

```ts !!request title="web3.js"
import { Connection, clusterApiUrl } from "@solana/web3.js";

const connection = new Connection(clusterApiUrl("devnet"), "confirmed");

let firstAvailableBlock = await connection.getFirstAvailableBlock();

console.log(firstAvailableBlock);
```

```rs !!request title="Rust"
use anyhow::Result;
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_commitment_config::CommitmentConfig;

#[tokio::main]
async fn main() -> Result<()> {
    let client = RpcClient::new_with_commitment(
        String::from("https://api.devnet.solana.com"),
        CommitmentConfig::confirmed(),
    );

    let first_available_block = client.get_first_available_block().await?;

    println!("{:#?}", first_available_block);

    Ok(())
}
```

### !params

### !!result

```jsonc !response
{
  "jsonrpc": "2.0",
  // !hover result
  "result": 250000,
  "id": 1
}
```

!type u64

Slot

</APIMethod>
