Skip to main content
POST
/
query
cURL
curl --request POST \
  --url https://api.example.com/query \
  --header 'Content-Type: application/json' \
  --data '
{
  "method": "query",
  "params": {
    "block_id": 1,
    "account_id": "<string>",
    "request_type": "view_account"
  },
  "id": "dontcare",
  "jsonrpc": "2.0"
}
'
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    method: 'query',
    params: {block_id: 1, account_id: '<string>', request_type: 'view_account'},
    id: 'dontcare',
    jsonrpc: '2.0'
  })
};

fetch('https://api.example.com/query', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
import requests

url = "https://api.example.com/query"

payload = {
    "method": "query",
    "params": {
        "block_id": 1,
        "account_id": "<string>",
        "request_type": "view_account"
    },
    "id": "dontcare",
    "jsonrpc": "2.0"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "result": {
    "amount": "<string>",
    "code_hash": "<string>",
    "locked": "<string>",
    "storage_usage": 1,
    "block_hash": "<string>",
    "block_height": 1,
    "global_contract_account_id": "<string>",
    "global_contract_hash": "<string>",
    "storage_paid_at": 0
  },
  "id": "<string>",
  "jsonrpc": "<string>"
}

Body

application/json
method
enum<string>
required
Available options:
query
params
view_account_by_block_id · object
required
id
string
default:dontcare

JSON-RPC request id. Auto-populated; can be any string.

jsonrpc
enum<string>
default:2.0

JSON-RPC protocol version. Always 2.0.

Available options:
2.0

Response

200 - application/json
result
object
required

A view of the account

id
string
required
jsonrpc
string
required