---
title: How to Get Account Balance
description:
  "Every account on Solana has a balance of SOL stored. Learn how to retrieve
  that account balance on Solana."
---

Every Solana account is required to maintain a minimum balance of native SOL
(lamports) to persist its data on the blockchain.

<CodeTabs storage="cookbook" flags="r">

```ts !! title="Kit" file=packages/docs-examples/cookbook/accounts/get-account-balance/kit.ts#region=balance highlight=6

```

```ts !! title="Legacy" file=packages/docs-examples/cookbook/accounts/get-account-balance/legacy.ts#region=balance highlight=5

```

```rust !! title="Rust" file=packages/docs-examples/cookbook/accounts/get-account-balance/rust/src/main.rs#region=balance

```

```py !! title="Python"
import asyncio
from solana.rpc.async_api import AsyncClient
from solders.pubkey import Pubkey

async def main():
    rpc = AsyncClient("http://localhost:8899")

    # Example public key (you can replace with any valid public key)
    account_pubkey = Pubkey.from_string("11111111111111111111111111111111")

    async with rpc:
        # Get account balance
        balance = await rpc.get_balance(account_pubkey)

        print(f"Account: {account_pubkey}")
        print(f"Balance: {balance.value} lamports")
        print(f"Balance: {balance.value / 1_000_000_000} SOL")

if __name__ == "__main__":
    asyncio.run(main())
```

</CodeTabs>
