# getBalance

Returns the lamport balance of the account of provided an account address (PublicKey)

#### Parameters required for this RPC call

* The account address for which we are fetching the account info. This is usually provided as a string.
* **configuration object**: This contains the following parameters.
  * commitment: The commitment describes how finalized a block is at that point in time.
  * minContextSlot: The minimum slot that the request can be evaluated at.

{% tabs %}
{% tab title="cURL" %}

```bash
curl https://rpc.shyft.to?api_key=YOUR-API-KEY -s -X \
  POST -H "Content-Type: application/json" -d ' 
   {
     "jsonrpc": "2.0",
     "id": 1,
     "method": "getBalance",
     "params": [
       "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
       {
         "commitment": "finalized"
       }
     ]
   }
 '
```

{% endtab %}

{% tab title="Web3.js" %}

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

const connection = new Connection("https://rpc.shyft.to?api_key=YOUR-API-KEY", "confirmed");
const publicKey = new PublicKey("83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri");
const balance = await connection.getBalance(publicKey);

console.log("Account Balance:", JSON.stringify(balance, null, 2));
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "jsonrpc": "2.0",
    "result": {
        "context": {
            "apiVersion": "2.2.16",
            "slot": 357068878
        },
        "value": 16362443 //indicates the balance of the account
    },
    "id": 2
}
```

{% endtab %}
{% endtabs %}
