Skip to main content

Get account resources

GEThttps://mainnet-aptos-api.moralis.io/accounts/:address/resources

Get account resources for a given address.

PATH PARAMS
addressstringrequired
Address of account with or without a 0x prefix
QUERY PARAMS
ledger_versionstring

Ledger version to get state of account. If not provided, it will be the latest version

limitnumber

Max number of account resources to retrieve. If not provided, defaults to default page size.

startstring

Cursor specifying where to start for pagination This cursor cannot be derived manually client-side. Instead, you must call this endpoint once without this query parameter specified, and then use the cursor returned in the X-Aptos-Cursor header in the response.

Responses
200 array
typestringrequired
String representation of a MoveStructTag (on-chain Move struct type). This exists so you can specify MoveStructTags as path / query parameters
datajsonrequired
This is a JSON representation of some data within an account resource. More specifically, it is a map of strings to arbitrary JSON values / objects, where the keys are top level fields within the given resource.
API KEY
import Moralis from 'moralis';

try {
await Moralis.start({
apiKey: "YOUR_API_KEY"
});

const response = await Moralis.AptosApi.accounts.getAccountResources({
"limit": 5,
"network": "mainnet"
});

console.log(response);
} catch (e) {
console.error(e);
}
Response Example
[
{
"type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>",
"data": {
"authentication_key": "0x0000000000000000000000000000000000000000000000000000000000000001",
"coin_register_events": {
"counter": "0",
"guid": {
"id": {
"addr": "0x1",
"creation_num": "0"
}
}
},
"self_address": "0x1",
"sequence_number": "0"
}
}
]