> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.galleon8.com/api-reference/node-api/solana/api-endpoints/standard-api/get-account-info/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.galleon8.com/_mcp/server. # getAccountInfo POST https://node-api-docs-proxy.galleon8.workers.dev Content-Type: application/json Returns account state and metadata for a Solana public key. Reference: https://docs.galleon8.com/api-reference/node-api/solana/api-endpoints/standard-api/get-account-info ## Request ### Body (application/json) This endpoint expects an object. - `pubkey` (string, required) — Public key of the account to query. - `config` (AccountInfoConfig, optional) — Optional account encoding and commitment configuration. ## Response ### 200 Account metadata and data with response context. - `context` (RpcContext, required) — Response context for a Solana RPC result. - `value` (AccountInfo, required, nullable) — Solana account state and metadata. ## Types ### AccountInfoConfig Configuration object for account data lookups. - `commitment` (enum, optional) — Solana commitment level. - Allowed values: `processed`, `confirmed`, `finalized` - `encoding` (enum, optional) — Account data encoding. - Allowed values: `base58`, `base64`, `base64+zstd`, `jsonParsed` - `dataSlice` (DataSlice, optional) — Optional slice of account data to return. - `minContextSlot` (integer, optional) — Solana slot number. ### RpcContext Response context for a Solana RPC result. - `slot` (integer, required) — Solana slot number. - `apiVersion` (string, optional) ### AccountInfo Solana account state and metadata. - `data` (AccountData, required) - `executable` (boolean, required) - `lamports` (integer, required) — Amount in lamports. - `owner` (string, required) — Base58-encoded Solana public key. - `rentEpoch` (integer, required) - `space` (integer, optional, nullable) — Non-negative byte length. ### DataSlice Optional slice of account data to return. - `offset` (integer, required) — Non-negative byte length. - `length` (integer, required) — Non-negative byte length. ### AccountData ## Examples **Request** ```json [ "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg", { "commitment": "finalized", "encoding": "base64" } ] ``` **Response** ```json { "jsonrpc": "2.0", "id": "1", "result": { "context": { "apiVersion": "2.2.3", "slot": 374628996 }, "value": { "data": [ "", "base64" ], "executable": false, "lamports": 88860054690252, "owner": "11111111111111111111111111111111", "rentEpoch": 0, "space": 0 } } } ``` **SDK Code** ```python import requests url = "https://node-api-docs-proxy.galleon8.workers.dev/" payload = [ "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg", { "commitment": "finalized", "encoding": "base64" } ] headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://node-api-docs-proxy.galleon8.workers.dev/'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '["vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",{"commitment":"finalized","encoding":"base64"}]' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://node-api-docs-proxy.galleon8.workers.dev/" payload := strings.NewReader("[\n \"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg\",\n {\n \"commitment\": \"finalized\",\n \"encoding\": \"base64\"\n }\n]") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://node-api-docs-proxy.galleon8.workers.dev/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "[\n \"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg\",\n {\n \"commitment\": \"finalized\",\n \"encoding\": \"base64\"\n }\n]" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://node-api-docs-proxy.galleon8.workers.dev/") .header("Content-Type", "application/json") .body("[\n \"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg\",\n {\n \"commitment\": \"finalized\",\n \"encoding\": \"base64\"\n }\n]") .asString(); ``` ```php request('POST', 'https://node-api-docs-proxy.galleon8.workers.dev/', [ 'body' => '[ "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg", { "commitment": "finalized", "encoding": "base64" } ]', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://node-api-docs-proxy.galleon8.workers.dev/"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "[\n \"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg\",\n {\n \"commitment\": \"finalized\",\n \"encoding\": \"base64\"\n }\n]", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = [ "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg", [ "commitment": "finalized", "encoding": "base64" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://node-api-docs-proxy.galleon8.workers.dev/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```