POSTview_account

NEAR Mainnethttps://near-mainnet.nodit.io/

Returns an account's balance, the amount locked for staking, storage usage, and the hash of its deployed contract code.

Call the query method with request_type: "view_account". Querying an account that does not exist returns the UNKNOWN_ACCOUNT error.

Request Body
jsonrpcstringrequired
idstringrequired

Request ID. Any string; it is returned unchanged in the response.

methodstringrequired
request_typestring (enum)required

Query type. Fixed to view_account for account lookups.

finalitystring (enum)

Specifies the block finality. Cannot be used together with block_id.

  • optimistic: the latest block the node has received (may be reorganized)
  • near-final: a Doomslug-final block (not reverted in most cases)
  • final: a fully finalized block
block_idinteger

Specifies the block to query by block height (integer) or block hash (base58 string). Cannot be used together with finality.

account_idstringrequired

NEAR account ID. A human-readable name (e.g. wrap.near) or a 64-character hex implicit account ID.

Responses
jsonrpcstring

JSON-RPC version

idstring

Request ID

amountstring

Liquid (non-staked) balance (yoctoNEAR, decimal string; 1 NEAR = 10^24 yoctoNEAR)

lockedstring

Amount locked for staking (yoctoNEAR, decimal string)

code_hashstring

Hash of the deployed contract code (base58). 11111111111111111111111111111111 for accounts without a contract.

global_contract_hashstring

Code hash (base58) of the global contract when the account uses one referenced by hash. Absent otherwise.

global_contract_account_idstring

Account ID of the global contract when the account uses one referenced by account ID. Absent otherwise.

storage_usageinteger

Storage used by the account (bytes)

storage_paid_atinteger

Deprecated field; always 0.

statestring

Whether the account is initialized. Present only for uninitialized universal accounts that have no access keys, code, or data yet; absent for initialized accounts.

bootstrap_nonceinteger

The nonce an uninitialized account must use for its first transaction (a self-signed state init). Present only while the account is uninitialized.

block_heightinteger

Block height.

Example: 220785385

block_hashstring

Base58-encoded 32-byte hash (block hash, chunk hash, transaction hash, etc.).

Example: 8EjuQRnAJiWkRmqxfexQFJWXXonuSMbz5AZziJLCWnWS

namestring (enum)

Error class. REQUEST_VALIDATION_ERROR (invalid request), HANDLER_ERROR (processing error), INTERNAL_ERROR (node internal error)

causeobject

The specific cause of the error.

namestring

Name of the error cause (e.g. UNKNOWN_BLOCK, UNKNOWN_ACCOUNT, PARSE_ERROR)

infoobject

Additional information about the error (block hash, height, account ID, etc.)

codeinteger

Legacy JSON-RPC error code (e.g. -32000 server error, -32700 parse error, -32601 method not found)

messagestring

Legacy error message

datastring

Legacy error details

X-API-KEY
RequestCU60
cURL
curl -X POST "https://near-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "dontcare",
    "method": "query",
    "params": {
      "request_type": "view_account",
      "finality": "final",
      "block_id": 220785385,
      "account_id": "wrap.near"
    }
  }'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "result": {
    "amount": "35723815013379603615441870164676",
    "locked": "0",
    "code_hash": "DL2f5xmZ44cQRP6vBMt94rvseH5d5KKnAGis2WkTAsh1",
    "storage_usage": 166761807,
    "storage_paid_at": 0,
    "block_height": 220785361,
    "block_hash": "AyJijzid9yDZcywK9gqC6UHewKxD8msrzJiMtBjw1Q8K"
  }
}