accounts_get
Overview
Returns core account information (sequence number and authentication key) for a given address.
Endpoint
GET /v1/accounts/{address}
Aptos-Specific Notes
- Accounts are resources; sequence numbers are required for building transactions.
- Addresses are 0x-prefixed hex strings; leading zeros are accepted.
Request
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
address | string | Yes | Account address (e.g., 0x1 ) |
Query Parameters
None.
Request Body
None.
Response
Success Response (200)
{
"sequence_number": "string",
"authentication_key": "string"
}
Error Responses
Status | Error Code | Description |
---|---|---|
400 | invalid_input | Invalid address format |
404 | account_not_found | Account doesn't exist |
500 | internal_error | Server error |
Code Examples
cURL
curl -s "https://api-aptos-mainnet.n.dwellir.com/YOUR_API_KEY/v1/accounts/0x1" \
-H "Accept: application/json"
TypeScript SDK
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const aptos = new Aptos(new AptosConfig({ network: Network.MAINNET, fullnode: "https://api-aptos-mainnet.n.dwellir.com/YOUR_API_KEY/v1" }));
const account = await aptos.getAccountInfo({ accountAddress: "0x1" });
Python SDK
from aptos_sdk.client import RestClient
client = RestClient("https://api-aptos-mainnet.n.dwellir.com/YOUR_API_KEY/v1")
account = client.account("0x1")
Rust SDK
use aptos_sdk::rest_client::Client;
let client = Client::new("https://api-aptos-mainnet.n.dwellir.com/YOUR_API_KEY/v1".parse()?);
let account = client.get_account("0x1").await?;
Common Use Cases
- Checking account existence before transactions
- Retrieving authentication keys for verification
- Getting sequence numbers for transaction building
Related Endpoints
- accounts_resources - Get account resources
- accounts_modules - Get account modules