getAccountInfo
Returns all information associated with the account of provided Pubkey

Parameters

  • <base-58 encoded string> - Pubkey of account to query
  • <object> - (optional) Config object:
    • encoding: (optional) <string> - data encoding for each returned transaction
    Accepts one of the following strings: ["json" (Default), "jsonParsed", "base58" (slow), "base64"] "jsonParsed" encoding attempts to use program-specific parsers to make the transaction.message.instructions list more human-readable; if a parser cannot be found, the instruction falls back to default JSON.
    • dataSlice: (optional) <object> - limits the returned account data using the provided offset: <usize> and length: <usize> fields Only available for "base58", "base64" or "base64+zstd" encodings.

Results

Valid Account
Invalid Account
<object> - a JSON object containing:
  • lamports: <u64>, number of lamports assigned to this account
  • owner: <base-58 encoded string>, Pubkey of the program this account has been assigned to
  • data: <[string, encoding]|object>, data associated with the account, either as encoded binary data or JSON format {<program>: <state>}, depending on encoding parameter
  • executable: <bool>, indicates if the account contains a program (and is strictly read-only)
  • rentEpoch: <u64>, the epoch at which this account will next owe rent
<null> - if the requested account doesn't exist

Example

Request

cURL
1
curl --location --request POST 'https://solana-mainnet.g.alchemy.com/v2/demo' \
2
--header 'Content-Type: application/json' \
3
--data-raw ' {
4
"jsonrpc": "2.0",
5
"id": 1,
6
"method": "getAccountInfo",
7
"params": [
8
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
9
{
10
"encoding": "base58"
11
}
12
]
13
}'
Copied!

Response

1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"context": {
5
"slot": 134461197
6
},
7
"value": {
8
"data": [
9
"",
10
"base58"
11
],
12
"executable": false,
13
"lamports": 410431055,
14
"owner": "11111111111111111111111111111111",
15
"rentEpoch": 311
16
}
17
},
18
"id": 1
19
}
Copied!