# Accounts

Endpoints for retrieving account information.

## Get account info

> Get the account data for the provided principal\
> \
> Where balance is the hex encoding of a unsigned 128-bit integer (big-endian), nonce is a unsigned 64-bit integer, and the proofs are provided as hex strings.\
> \
> For non-existent accounts, this does not 404, rather it returns an object with balance and nonce of 0.<br>

```json
{"openapi":"3.1.0","info":{"title":"Stacks 3.0+ RPC API","version":"1.0.0"},"tags":[{"name":"Accounts","description":"Endpoints for retrieving account information."}],"servers":[{"url":"http://localhost:20443","description":"Local Stacks Node"},{"url":"https://api.mainnet.hiro.so","description":"Stacks Mainnet API"},{"url":"https://api.testnet.hiro.so","description":"Stacks Testnet API"}],"security":[],"paths":{"/v2/accounts/{principal}":{"get":{"summary":"Get account info","tags":["Accounts"],"operationId":"getAccountInfo","description":"Get the account data for the provided principal\n\nWhere balance is the hex encoding of a unsigned 128-bit integer (big-endian), nonce is a unsigned 64-bit integer, and the proofs are provided as hex strings.\n\nFor non-existent accounts, this does not 404, rather it returns an object with balance and nonce of 0.\n","parameters":[{"name":"principal","in":"path","required":true,"description":"Stacks address (28-41 characters) or a Contract identifier in format `{address}.{contract_name}`\n(e.g. `SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info`).\nContract names have a maximum length of 40 characters for new contracts. Legacy contracts may have names up to 128 characters.\n","schema":{"type":"string","pattern":"^S[PTMN][0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26,39}(\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,127})?$","minLength":28,"maxLength":170}},{"name":"proof","in":"query","schema":{"type":"integer","enum":[0,1],"default":1},"description":"Controls MARF proof inclusion in response. Set to 1 (default) to include proof, 0 to exclude.\nInvalid values default to 0 (no proof).\n"},{"name":"tip","in":"query","schema":{"type":"string","pattern":"^(latest|[0-9a-f]{64})?$","maxLength":64},"description":"Stacks chain tip to query from. Options:\n- (empty/omitted): Use latest anchored tip (canonical confirmed state)\n- `latest`: Use latest known tip including unconfirmed microblocks\n- `{block_id}`: Use specific block ID (64 hex characters)\n"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"description":"GET request for account data","type":"object","additionalProperties":false,"required":["balance","locked","unlock_height","nonce"],"properties":{"balance":{"type":"string"},"locked":{"type":"string"},"unlock_height":{"type":"integer","minimum":0,"description":"Block height when locked balance unlocks (64-bit unsigned integer)"},"nonce":{"type":"integer","minimum":0,"description":"Account transaction nonce (64-bit unsigned integer)"},"balance_proof":{"type":"string","description":"Merkle proof for the balance value"},"nonce_proof":{"type":"string","description":"Merkle proof for the nonce value"}}}}}},"400":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```
