# getLargestAccounts

Returns the 20 largest accounts, by lamport balance (results may be cached up to two hours)

#### Parameters required for this RPC call

* An array of addresses to query, as base-58 encoded strings
* **configuration** : This contains the following parameters, all are optional fields.
  * **commitment**: The commitment describes how finalized a block is at that point in time. <mark style="color:yellow;">processed</mark>, <mark style="color:yellow;">confirmed</mark> and <mark style="color:yellow;">finalized</mark> are supported.
  * **filter**: Filter results by account type. The values can be <mark style="color:yellow;">circulating</mark> or <mark style="color:yellow;">nonCirculating</mark>.

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

<pre class="language-bash"><code class="lang-bash">curl https://rpc.shyft.to?api_key=YOUR-API-KEY -s -X \
<strong>  POST -H "Content-Type: application/json" -d ' 
</strong>   {
     "jsonrpc": "2.0",
     "id": 1,
     "method": "getLargestAccounts",
     "params": [
       {
         "commitment": "finalized"
       }
     ]
   }
 '
</code></pre>

{% 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");

let config: GetLargestAccountsConfig = {
  commitment: "finalized",
  filter: "circulating",
};

let largestAccounts = await connection.getLargestAccounts(config);

console.log(largestAccounts);
```

{% endtab %}

{% tab title="Response" %}

```json
{
  "jsonrpc": "2.0",
  "result": {
    "context": { "slot": 54 },
    "value": [
      {
        "address": "99P8ZgtJYe1buSK8JXkvpLh8xPsCFuLYhz9hQFNw93WJ",
        "lamports": 999974
      },
      {
        "address": "uPwWLo16MVehpyWqsLkK3Ka8nLowWvAHbBChqv2FZeL",
        "lamports": 42
      }
    ]
  },
  "id": 1
}
```

{% endtab %}
{% endtabs %}
