QAN TestNet Docs

qan_getAccount

API details

Retrieves account details by specifying an address and a block number/tag.

Parameters for "qan_getAccount"

Path parameters
AddressstringRequired

The account address for which the information is to be retrieved

BlockReferencestringRequired

The block number in hexadecimal or decimal format or the string latest, earliest, pending, see the default block parameter description in the official Ethereum documentation

HTTP response status codes for "qan_getAccount"

Status Code Description
200 OK
400 Bad Request
404 Not Found
422 Unprocessable Entity
500 Internal Server Error

Code samples for "qan_getAccount"

Request examples

get/getAccount/{Address}/{BlockReference}/
cURLJavaScriptGoPython
curl --request GET \
  --url https://rpc-testnet.qanplatform.com/getAccount/%7BAddress%7D/%7BBlockReference%7D/ \
  --header 'Accept: application/json, , application/problem+json'
const options = {
  method: 'GET',
  headers: {Accept: 'application/json, , application/problem+json'}
};

fetch('https://rpc-testnet.qanplatform.com/getAccount/%7BAddress%7D/%7BBlockReference%7D/', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {

  url := "https://rpc-testnet.qanplatform.com/getAccount/%7BAddress%7D/%7BBlockReference%7D/"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Accept", "application/json, , application/problem+json")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)

  fmt.Println(string(body))

}
import requests

url = "https://rpc-testnet.qanplatform.com/getAccount/%7BAddress%7D/%7BBlockReference%7D/"

headers = {"Accept": "application/json, , application/problem+json"}

response = requests.get(url, headers=headers)

print(response.text)

Response examples

200400404422500
Content type: application/json
{"Balance":"string","CodeHash":"string","Nonce":"string","StorageRoot":"string"}
Content type: application/problem+json
{}
Content type: application/problem+json
{}
Content type: application/problem+json
{}
Content type: application/problem+json
{}

Previous

qan_gasprice

Next

qan_getbalance