# getTokenLargestAccounts

> import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import CreditCost from '@site/src/components/CreditCost/CreditCostPrice.js'

# `getTokenLargestAccounts`

Returns the 20 largest accounts holding a specified SPL token type. <CreditCost network="solana" method="getTokenLargestAccounts" />

## Parameters

- `address`: (string) _[required]_ - The `base58` encoded public key of the token mint to query.
- `config`: (object) _[optional]_ - Configuration object with the following options:
  - `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
    - `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
      reached maximum lockout, meaning the cluster has recognized this block as finalized.
    - `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
    - `processed` - Queries its most recent block. The block may still be skipped by the cluster.

## Returns

`result` - An array of objects with the following fields:

- `context` - An object containing the following keys:
  - `slot` - The slot number of the block that was queried.
  - `apiVersion` - The API version used for the query.
- `value` - An object with the following fields:
  - `address` - The address of the token account.
  - `amount` - The raw total token supply without decimals, a string representation of a `u64` integer.
  - `decimals` - An integer value representing the number of decimal places used by the token.
  - `uiAmount` - Deprecated. The total token supply using mint-prescribed decimals.
  - `uiAmountString` - The total token supply as a string using mint-prescribed decimals.

## Example

Replace `<YOUR-API-KEY>` with your API key.

### Request

<Tabs>
  <TabItem value="curl">

```bash
curl https://solana-mainnet.infura.io/v3/<YOUR-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0", "id":1, "method":"getTokenLargestAccounts", "params": ["1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE"]}'
```

    </TabItem>

</Tabs>

### Response

<Tabs>
  <TabItem value="JSON">

```bash
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "apiVersion": "2.1.16",
      "slot": 332646796
    },
    "value": [
      {
        "address": "GFpkRJXUBNDWXENKAJ1dkYq4kYpHyNmgbifZbHsXXz4x",
        "amount": "12",
        "decimals": 0,
        "uiAmount": 12,
        "uiAmountString": "12"
      },
      ...
      {
        "address": "GrxprwFYdFV4kdHjQDTWsdDFn9KtFn1p35rSZYDFgMkD",
        "amount": "3",
        "decimals": 0,
        "uiAmount": 3,
        "uiAmountString": "3"
      }
    ]
  },
  "id": 1
}
```

  </TabItem>
</Tabs>
