> For the complete documentation index, see [llms.txt](https://docs.stacks.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stacks.co/reference/api/stacks-node-rpc/accounts.md).

# 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"}],"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":[{"$ref":"#/components/parameters/principal"},{"$ref":"#/components/parameters/proof"},{"$ref":"#/components/parameters/tip"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountData"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"parameters":{"principal":{"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":{"$ref":"#/components/schemas/Principal"}},"proof":{"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"},"tip":{"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  If no unconfirmed state is available, falls back to the confirmed canonical tip.\n  If the unconfirmed state check fails with an error, returns 404.\n- `{block_id}`: Use specific block ID (64 lowercase hex characters)\n\n**Note:** If `tip` is present but contains an invalid or malformed value\n(i.e., not `latest` and not a valid 64-character hex block ID),\nthe node silently falls back to the latest anchored tip (same as omitting `tip`).\n"}},"schemas":{"Principal":{"type":"string","pattern":"^S[PTMN][0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26,39}(\\.[a-zA-Z]([a-zA-Z0-9]|[-_]){0,127})?$","minLength":28,"maxLength":170},"AccountData":{"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"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"text/plain":{"schema":{"type":"string"}}}},"NotFound":{"description":"Not found","content":{"text/plain":{"schema":{"type":"string"}}}},"InternalServerError":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stacks.co/reference/api/stacks-node-rpc/accounts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
