Aptos Node API
The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
Accounts
Access to accounts, resources, and modules
Get account
Return the authentication key and the sequence number for an account address. Optionally, a ledger version can be specified. If the ledger version is not specified in the request, the latest ledger version is used.
- addressrequiredstring hex
Address of account with or without a
0x
prefixExample0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1
- ledger_versionstring uint64
Ledger version to get state of account
If not provided, it will be the latest version
Example32425224034
- 200application/json
- 400application/json
- 403application/json
- 404application/json
- 410application/json
- 500application/json
- 503application/json
curl --request GET \
--url https://api.mainnet.aptoslabs.com/v1/accounts/0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1
{
"sequence_number": "32425224034",
"authentication_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
}
Get account resources
Retrieves all account resources for a given account and a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used.
The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.
- addressrequiredstring hex
Address of account with or without a
0x
prefixExample0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1
- ledger_versionstring uint64
Ledger version to get state of account
If not provided, it will be the latest version
Example32425224034
- 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.
Example0000000000000000000000000000000000000000000000000000000000000000012f0000000000000000000000000000000000000000000000000000000000000000010d7374616b696e675f70726f7879
- limitinteger uint16
Max number of account resources to retrieve
If not provided, defaults to default page size.
- 200application/json
- 400application/json
- 403application/json
- 404application/json
- 410application/json
- 500application/json
- 503application/json
curl --request GET \
--url https://api.mainnet.aptoslabs.com/v1/accounts/0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 /resources
[
{
"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"
}
}
]
Get account resources
Retrieves all account resources for a given account and a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used.
The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.
- addressrequiredstring hex
Address of account with or without a
0x
prefixExample0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1
- asset_typerequiredstring hex
A hex encoded 32 byte Aptos account address or a struct tag.
This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x or Format:
{address}::{module name}::{struct name}
Example0x1::aptos_coin::AptosCoin
- ledger_versionstring uint64
Ledger version to get state of account
If not provided, it will be the latest version
Example32425224034
- 200application/json
- 400application/json
- 403application/json
- 404application/json
- 410application/json
- 500application/json
- 503application/json
curl --request GET \
--url https://api.mainnet.aptoslabs.com/v1/accounts/0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 /balance/0x1::aptos_coin::AptosCoin
1
Get account modules
Retrieves all account modules' bytecode for a given account at a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used.
The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.
- addressrequiredstring hex
Address of account with or without a
0x
prefixExample0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1
- ledger_versionstring uint64
Ledger version to get state of account
If not provided, it will be the latest version
Example32425224034
- 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.
Example0000000000000000000000000000000000000000000000000000000000000000012f0000000000000000000000000000000000000000000000000000000000000000010d7374616b696e675f70726f7879
- limitinteger uint16
Max number of account modules to retrieve
If not provided, defaults to default page size.
- 200application/json
- 400application/json
- 403application/json
- 404application/json
- 410application/json
- 500application/json
- 503application/json
curl --request GET \
--url https://api.mainnet.aptoslabs.com/v1/accounts/0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 /modules
[
{
"bytecode": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
"abi": {
"address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
"name": "…",
"friends": [
"0x1::aptos_coin"
],
"exposed_functions": [
{
"name": "…",
"visibility": "private",
"is_entry": true,
"is_view": true,
"generic_type_params": [
null
],
"params": [
null
],
"return": [
null
]
}
],
"structs": [
{
"name": "…",
"is_native": true,
"is_event": true,
"abilities": [
null
],
"generic_type_params": [
null
],
"fields": [
null
]
}
]
}
}
]
Get account resource
Retrieves an individual resource from a given account and at a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used.
The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.
- addressrequiredstring hex
Address of account with or without a
0x
prefixExample0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1
- resource_typerequiredstring
^0x[0-9a-zA-Z:_<>]+$
Name of struct to retrieve e.g.
0x1::account::Account
Example0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>
- ledger_versionstring uint64
Ledger version to get state of account
If not provided, it will be the latest version
Example32425224034
- 200application/json
- 400application/json
- 403application/json
- 404application/json
- 410application/json
- 500application/json
- 503application/json
curl --request GET \
--url https://api.mainnet.aptoslabs.com/v1/accounts/0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 /resource/0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>
{
"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"
}
}
Models
address Required |
Content-Type | application/json | |
ledger_version |