accounts_resource
Overview
Fetch a specific resource under an account by its full type string.
Endpoint
GET /v1/accounts/{address}/resource/{resource_type}
Aptos-Specific Notes
- Encode generic types using fully qualified type strings.
Request
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
address | string | Yes | Account address |
resource_type | string | Yes | Type tag, e.g. 0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> |
Query Parameters
Name | Type | Required | Description |
---|---|---|---|
ledger_version | string | No | Historical version read |
Request Body
None.
Response
{
"type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>",
"data": { "coin": { "value": "123" } }
}
Code Examples
cURL
curl -s "https://api-aptos-mainnet.n.dwellir.com/YOUR_API_KEY/v1/accounts/0x1/resource/0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>"
TypeScript
const r = await aptos.getAccountResource({
accountAddress: "0x1",
resourceType: "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>",
});
Python
resource = client.account_resource(
"0x1",
"0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>"
)
Rust
let r = client.get_account_resource("0x1", "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>").await?;