> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# requestAirdrop

> Requests a faucet transaction that transfers lamports to the supplied Pubkey.

<Info>
  **Source**

  [`request_airdrop`](https://github.com/anza-xyz/agave/blob/v4.3.2/rpc/src/rpc.rs#L3836)
</Info>

<Warning>
  The public devnet and testnet endpoints no longer serve airdrops:
  `requestAirdrop` returns HTTP `410` ("The RPC faucet is closed on this
  cluster"), and the Solana CLI reports it as a rate limit. Get devnet or
  testnet SOL from the [Solana Faucet](https://faucet.solana.com). Use
  `requestAirdrop` on a local network, such as Surfpool or
  `solana-test-validator` at `http://localhost:8899`, as the examples on this
  page do. Mainnet has no faucet.
</Warning>

<RequestExample>
  ```bash cURL
  curl http://localhost:8899 -s -X POST \
    -H "Content-Type: application/json" \
    -d '
    {
      "jsonrpc": "2.0",
      "id": 1,
      "method": "requestAirdrop",
      "params": [
        "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
        1000000000,
        {
          "commitment": "finalized"
        }
      ]
    }
  '
  ```

  ```ts Kit
  import { address, createSolanaRpc, lamports } from "@solana/kit";

  const rpc_url = "http://localhost:8899";
  const rpc = createSolanaRpc(rpc_url);

  let receiver = address("4kg8oh3jdNtn7j2wcS7TrUua31AgbLzDVkBZgTAe44aF");

  // 1 SOL
  let airdropAmt = lamports(1_000_000_000n);

  let signature = await rpc.requestAirdrop(receiver, airdropAmt).send();

  console.log(signature);
  ```

  ```ts web3.js
  import { Connection, LAMPORTS_PER_SOL, PublicKey } from "@solana/web3.js";

  const connection = new Connection("http://localhost:8899", "confirmed");

  let receiver = new PublicKey("4kg8oh3jdNtn7j2wcS7TrUua31AgbLzDVkBZgTAe44aF");

  let airdropAmt = 1 * LAMPORTS_PER_SOL;

  let sig = await connection.requestAirdrop(receiver, airdropAmt);

  console.log(sig);
  ```

  ```rs Rust
  use anyhow::Result;
  use solana_client::nonblocking::rpc_client::RpcClient;
  use solana_commitment_config::CommitmentConfig;
  use solana_sdk::{native_token::LAMPORTS_PER_SOL, pubkey};

  #[tokio::main]
  async fn main() -> Result<()> {
      let client = RpcClient::new_with_commitment(
          String::from("http://localhost:8899"),
          CommitmentConfig::confirmed(),
      );

      let receiver = pubkey!("4kg8oh3jdNtn7j2wcS7TrUua31AgbLzDVkBZgTAe44aF");

      let lamports = 1 * LAMPORTS_PER_SOL;

      let transaction_signature = client.request_airdrop(&receiver, lamports).await?;
      loop {
          if client.confirm_transaction(&transaction_signature).await? {
              break;
          }
      }

      println!("{}", transaction_signature);

      Ok(())
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response
  {
    "jsonrpc": "2.0",
    "result": "4cdd1oX7cfVALfr26tP52BZ6cSzrgnNGtYD7BFhm6FFeZV5sPTnRvg6NRn8yC6DbEikXcrNChBM5vVJnTgKhGhVu",
    "id": 1
  }
  ```
</ResponseExample>

## Parameters

<ParamField body="pubkey" type="string" required>
  Pubkey of account to receive lamports, as a base-58 encoded string
</ParamField>

<ParamField body="lamports" type="u64" required>
  Amount of lamports to airdrop
</ParamField>

<ParamField body="config" type="object">
  Configuration object containing the following fields:

  <Expandable title="properties" defaultOpen>
    <ParamField body="commitment" type="string" default="finalized">
      Values: `processed`, `confirmed`, `finalized`

      Solana RPC uses the following commitment levels:

      | Value       | Description                                                                                                                                                                               |
      | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
      | `processed` | Return data from the highest slot this node has processed. This is the newest view, but the block can still be skipped.                                                                   |
      | `confirmed` | Return data from the same slot as `finalized`. Kept for compatibility and planned for removal in a later release.                                                                         |
      | `finalized` | Return data from the highest slot with a finalization certificate, from votes by 80% of stake in one round or 60% of stake in each of two rounds. This is the strongest commitment level. |
    </ParamField>

    <ParamField body="recentBlockhash" type="string">
      Use this recent blockhash for the faucet transaction instead of the node's
      current confirmed blockhash

      ```json Example
      { "recentBlockhash": "EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N" }
      ```
    </ParamField>
  </Expandable>
</ParamField>

## Result

<ResponseField name="result" type="string">
  Transaction Signature of the airdrop, as a base-58 encoded string
</ResponseField>
