Get account resource
GET
Returns the resource for an account address. You can specify the ledger version of the transaction; if no ledger version is specified, the latest ledger version is returned.Aptos nodes prune account state history according to a configurable retention period. If the requested ledger version has been pruned, the server responds with a 410 status code.
Path Parameters
chainstringrequired
Parameter specifying the target chain to query.networkstringrequired
Parameter specifying the network of the target chain.addressstringrequired
The address of the account to retrieve. Account addresses without the hexadecimal prefix can also be queried.resource_typestringrequired
The type name of the target resource (struct) to retrieve.Query Parameters
ledger_versioninteger
The ledger version of the transaction to fetch account state from.If no value is provided, the latest version is used.Responses
typestring
String representation of a Move struct tag.This type exists to allow MoveStructTag to be specified as a path or query parameter (e.g. used in get_events_by_event_handle).This value is composed of:1. move_module_address, module_name, struct_name joined by two colons (::)2. Generic type parameters of the struct specified as comma-separated valuesExamples:0x1::coin::CoinStore<0x1::aptos_coin::aptosCoin>0x1::account::Account
dataobject
Partial data from within an account resource, displayed in JSON representation.Specifically, a map with the top-level field keys of the given resource as keys and arbitrary JSON values/objects as values.- Move bool type: Converted to boolean.
- u8~i32: Converted to integer.
- u64~i256: Converted to string.
- address: Converted to HexEncodedBytes string (e.g. 0x1).
- Struct: Converted to object.
- vector: Converted to array.
- However, vector<u8> is converted to a HexEncodedBytes string starting with 0x.
- 0x1::string::String: Converted to regular string.
codestringrequired
Code identifying the cause of the failed request.messagestringrequired
Detailed message including the name and value of the invalid parameter.{"code": "ERROR_CODE","message": "Bad Request"}
cURL
curl -X GET 'https://aptos-mainnet.nodit.io/v1/accounts/0x1/resources/0x1::account::Account' \-H 'Content-Type: application/json' \-H 'X-API-KEY: nodit-demo'