# getBalance

Gets the balance of the specified asset for the specified account.

## Parameters

#### 1. asset *(required)*

`UInt160`

The contract hash of the asset or token.

#### 2. account *(required)*

`UInt160`

The script hash of the account to query.

## Returns

`Promise<Integer>`

`Integer` can be returned as a string or number.

## Errors

| Code    | Name        | Description                           |
| ------- | ----------- | ------------------------------------- |
| `10002` | `INVALID`   | One or more inputs are invalid.       |
| `10003` | `NOTFOUND`  | The account or asset cannot be found. |
| `10004` | `FAILED`    | Contract execution failed.            |
| `10008` | `RPC_ERROR` | The RPC server returned an error.     |

## Example

### Request

```js
const balance = await provider.getBalance(
  "0xd2a4cff31913016155e38e474a2c06d08be276cf",
  "0x9a7c5085dcdd4adf9ec12f2d1a7d6b741ad4b20a",
);
```

### Response

```js
"2166122424085"
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tutorial.neoline.io/reference/neo3-provider-api/getbalance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
