Overview
The getAccountInfo method returns all information associated with the account of provided public key. This is one of the most commonly used RPC methods for retrieving on-chain data from Solana.
FluxRPC Performance Advantage
FluxRPC delivers getAccountInfo responses up to 3x faster than other RPC providers, with average response times of just 45ms compared to 120-150ms from competitors. This superior performance is especially critical for applications that need to fetch multiple accounts in sequence.
Request
Endpoint
POST https://api.fluxbeam.xyz
Headers
| Name | Required | Description |
|---|---|---|
| Content-Type | Yes | application/json |
| X-API-Key | Yes | Your FluxRPC API key |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| jsonrpc | string | Yes | JSON-RPC version ("2.0") |
| id | string/number | Yes | Request identifier |
| method | string | Yes | "getAccountInfo" |
| params | array | Yes | Array containing the account public key and configuration object |
Parameters Object
| Parameter | Type | Required | Description |
|---|---|---|---|
| encoding | string | No | Encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". Default is "base64". |
| dataSlice | object | No | Limit the returned account data using a slice |
| commitment | string | No | Commitment level: "processed", "confirmed", or "finalized". Default is "finalized". |
| minContextSlot | number | No | The minimum slot that the request can be evaluated at |
Example Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "getAccountInfo",
"params": [
"83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
{
"encoding": "jsonParsed",
"commitment": "confirmed"
}
]
}
Response
Success Response
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 430
},
"value": {
"data": [
"11116bv5nS2h3y12kD1yUKeMZvGcKLSjQgX6BeV7u1FrjeJcKfsHRTPuR3oZ1EioKtYGiYxpxMG5vpbZLsbcBYBEmZZcMKaSoGx9JZeAuWf",
"base58"
],
"executable": false,
"lamports": 1000000000,
"owner": "11111111111111111111111111111111",
"rentEpoch": 2
}
},
"id": 1
}
Example Response with jsonParsed encoding
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 430
},
"value": {
"data": {
"parsed": {
"info": {
"isNative": true,
"mint": "So11111111111111111111111111111111111111112",
"owner": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
"state": "initialized",
"tokenAmount": {
"amount": "1000000000",
"decimals": 9,
"uiAmount": 1,
"uiAmountString": "1"
}
},
"type": "account"
},
"program": "spl-token",
"space": 165
},
"executable": false,
"lamports": 2039280,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 207
}
},
"id": 1
}
Error Response
{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "Invalid param: WrongSize"
},
"id": 1
}
Usage Notes
- For token accounts, using
encoding: "jsonParsed"will return human-readable token data. - For large accounts, consider using
dataSliceto limit the amount of data returned if you only need a portion of it. - The
commitmentparameter determines how finalized the data should be. For most applications, "confirmed" provides a good balance between speed and certainty. - If the account doesn't exist, the
valuefield in the response will benull.
Performance Optimization Tips
To get the best performance from FluxRPC's getAccountInfo method:
- Use
base64encoding when possible, as it's faster thanbase58. - Only use
jsonParsedwhen you need the parsed data structure. - Use
dataSliceto limit data transfer when you only need specific portions of large accounts. - Consider using
getMultipleAccountsif you need to fetch multiple accounts at once. - For optimal performance, FluxRPC's
getAccountInfomethod is up to 3x faster than other RPC providers, with average response times of just 45ms.
Response Time Comparison
| RPC Provider | Average Response Time (ms) | 95th Percentile (ms) |
|---|---|---|
| FluxRPC | 45 | 68 |
| Provider B | 120 | 180 |
| Provider C | 150 | 220 |
* Performance data based on average response times measured from multiple global locations.