Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.0

Get account resource

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

Get a specific account resource type for a given address.

PATH PARAMS
addressstringrequired
Address of account with or without a 0x prefix
resource_typestringrequired
Name of struct to retrieve e.g. 0x1::account::Account
QUERY PARAMS
ledger_versionstring

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

Responses
API KEY
import Moralis from 'moralis';

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

const response = await Moralis.AptosApi.accounts.getAccountResource({});

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"
}
}