getTokenLargestAccounts RPC Method
Please note that, in addition to the plan-level rate limits, the getTokenLargestAccounts method has a specific rate limit of 50 requests per second. This limit may change without notice to ensure system stability. For high-demand use cases, please reach out to discuss potential solutions.
Parameters
pubkey
string
Loading...
object
object
Loading...
commitment
string
Loading...
Returns
result
Loading...
context
Loading...
apiVersion
Loading...
slot
Loading...
value
Loading...
address
Loading...
amount
Loading...
decimals
Loading...
uiAmount
Loading...
uiAmountString
Loading...
Request
curl https://docs-demo.solana-mainnet.quiknode.pro/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0", "id":1, "method":"getTokenLargestAccounts", "params": ["1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE"]}'
require "uri" require "json" require "net/http" url = URI("https://docs-demo.solana-mainnet.quiknode.pro/") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getTokenLargestAccounts", "params": [ "1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE" ] }) response = https.request(request) puts response.read_body
import { createSolanaRpc, address } from "@solana/kit"; (async () => { const solanaRpc = createSolanaRpc("https://docs-demo.solana-mainnet.quiknode.pro/"); const mintAccount = address("1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE"); try { const largestAccounts = await solanaRpc.getTokenLargestAccounts(mintAccount).send(); console.log(largestAccounts); } catch (error) { console.error("Error fetching token largest accounts:", error); } })();
const web3 = require("@solana/web3.js"); (async () => { const url = "https://docs-demo.solana-mainnet.quiknode.pro/"; const solana = new web3.Connection(url); console.log( await solana.getTokenLargestAccounts( new web3.PublicKey("1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE") ) ); })();
import base58 from solana.rpc.api import Client from solders.pubkey import Pubkey solana_client = Client("https://docs-demo.solana-mainnet.quiknode.pro/") encoded_pubkey = "1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE" decoded_pubkey = base58.b58decode(encoded_pubkey) print(len(decoded_pubkey)) #32 bytes address = Pubkey(decoded_pubkey) print(solana_client.get_token_largest_accounts(address))
use reqwest::header; use reqwest::Client; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box<dyn Error>> { let mut headers = header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = Client::new(); let json_data = r#" { "jsonrpc": "2.0", "id": 1, "method": "getTokenLargestAccounts", "params": [ "1YDQ35V8g68FGvcT85haHwAXv1U7XMzuc4mZeEXfrjE" ] } "#; let response = client .post("https://docs-demo.solana-mainnet.quiknode.pro/") .headers(headers) .body(json_data) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) }
Response
{ "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.1.21", "slot": 335501755 }, "value": [ { "address": "GFpkRJXUBNDWXENKAJ1dkYq4kYpHyNmgbifZbHsXXz4x", "amount": "12", "decimals": 0, "uiAmount": 12, "uiAmountString": "12" }, { "address": "DhzDoryP2a4rMK2bcWwJxrE2uW6ir81ES8ZwJJPPpxDN", "amount": "12", "decimals": 0, "uiAmount": 12, "uiAmountString": "12" }, { "address": "GCHHBydcirSJHwoMBN9NcDoVkqsNPPfgGqxhxQ1Txzgm", "amount": "7", "decimals": 0, "uiAmount": 7, "uiAmountString": "7" }, { "address": "CoMMaw8ue3wtMv4gdaDaTpQTKEfkB22veBqdbyQkFxFT", "amount": "7", "decimals": 0, "uiAmount": 7, "uiAmountString": "7" }, { "address": "HbM54qzsMyN7knoNdfh5wNyoX6NRgQ2pNVaVhbLEAGSG", "amount": "6", "decimals": 0, "uiAmount": 6, "uiAmountString": "6" }, { "address": "F8qLyj9e1q6V17B5fNKjbs2q3tfS5pY3t5V3fRhLxrd1", "amount": "6", "decimals": 0, "uiAmount": 6, "uiAmountString": "6" }, { "address": "ELQiMt78Q5LjFByJyPMN4fnkKBeLUKcFiCDS5m1WXxEG", "amount": "6", "decimals": 0, "uiAmount": 6, "uiAmountString": "6" }, { "address": "4emdk6bq3WUGTmhURCJpZvVLEpPNmViTkdqjjS3fw9Jw", "amount": "6", "decimals": 0, "uiAmount": 6, "uiAmountString": "6" }, { "address": "9zYznMvAhNe5Bz68Ms2rnErtUErfnrdMxC1yGjNTNuY3", "amount": "5", "decimals": 0, "uiAmount": 5, "uiAmountString": "5" }, { "address": "9duBrvbQPiNng7ggy58pVhV8RieLZnyD6TuKCMhcqzjp", "amount": "5", "decimals": 0, "uiAmount": 5, "uiAmountString": "5" }, { "address": "9P7bS6fAZkjGgsqDM6sxLZe8d1Z1aTcwcYeZpQhgjBLp", "amount": "5", "decimals": 0, "uiAmount": 5, "uiAmountString": "5" }, { "address": "F7mYcpLFbTbpLzeg9mAMaAx8g9Xf4b8uuYVzmi11oKaR", "amount": "4", "decimals": 0, "uiAmount": 4, "uiAmountString": "4" }, { "address": "AfKWLaaczdTL5CkMfG2mJz9B8zbFkhJTqSQGehkxPaAC", "amount": "4", "decimals": 0, "uiAmount": 4, "uiAmountString": "4" }, { "address": "JDHGgp9hiB7ftqRonFw9r6RNnKjmxmXp76SeVEfgb1id", "amount": "3", "decimals": 0, "uiAmount": 3, "uiAmountString": "3" }, { "address": "Hzy2sa7XhkPCpCB8RgFf5cpHEv7C9N2RCHNepcQyCJVx", "amount": "3", "decimals": 0, "uiAmount": 3, "uiAmountString": "3" }, { "address": "Hfib1ie8WmLgL6ouC9TG17exGR6ea6vm4E8MAwkE3JHP", "amount": "3", "decimals": 0, "uiAmount": 3, "uiAmountString": "3" }, { "address": "HdgKpJGqJqAttG7co9apDac6R2zLcMYwQLba5A18fwST", "amount": "3", "decimals": 0, "uiAmount": 3, "uiAmountString": "3" }, { "address": "H1muh5g5GYu8VWnCJZ1fc79Yw9D6NZBCsVhtzjfFudhc", "amount": "3", "decimals": 0, "uiAmount": 3, "uiAmountString": "3" }, { "address": "GyTnLYQNN7QN8huEgHBNpNUZxNgRqUir6ho9GVoo4jz7", "amount": "3", "decimals": 0, "uiAmount": 3, "uiAmountString": "3" }, { "address": "GrxprwFYdFV4kdHjQDTWsdDFn9KtFn1p35rSZYDFgMkD", "amount": "3", "decimals": 0, "uiAmount": 3, "uiAmountString": "3" } ] }, "id": 1 }
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free