# Balance

## `GET /v1/:currency/Addresses/:address`

Retrieve the current balance of an address.

### Request

#### Path Parameters

| Attribute | Type     | Description                                                                                  |
| --------- | -------- | -------------------------------------------------------------------------------------------- |
| currency  | `string` | The [currency](/api/currency-and-conversion-symbols.md#currency-symbols) unit of the balance |
| address   | `string` | The public address associated with the transactions.                                         |

#### Query Parameters

| Attribute             | Type      | Description                                                                                                                                  |
| --------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| includeUnspentOutputs | `boolean` | ***Optional.*** Unspent transaction outputs of the address. Available only for BTC addresses and if`includeUnspentOutputs` is set to `true`. |

### Response

| HTTP Status | Return Object                      |
| ----------- | ---------------------------------- |
| 200         | [Balance](/api/balance.md#balance) |

#### Balance

| Attribute      | Type                                                        | Description                                                                                                                  |
| -------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Balance        | `string`                                                    | A string representing how much balance in the currency unit (e.g., `"1.23"` for 1.23 USD-G).                                 |
| Currency       | `string`                                                    | The [currency](/api/currency-and-conversion-symbols.md#currency-symbols) unit of the balance                                 |
| UnspentOutputs | `array of` [`UnspentOutput`](/api/balance.md#unspentoutput) | Unspent transaction outputs of the address. Available only for BTC addresses and if`includeUnspentOutputs` is set to `true`. |

#### UnspentOutput

| Attribute     | Type     | Description                                       |
| ------------- | -------- | ------------------------------------------------- |
| Amount        | `string` | Bitcoin amount in the output index.               |
| TxHash        | `string` | Hash of the transaction that contains the output. |
| Index         | `int`    | Index of the output.                              |
| Confirmations | `int`    | The number of confirmations for the transaction   |

### Errors

| HTTP Status | Error Code             | Description                                    |
| ----------- | ---------------------- | ---------------------------------------------- |
| 400         | `BadRequest`           | Invalid address format.                        |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                         |
| 500         | `InternalServerError`  | Server error.                                  |
| 503         | `ServiceUnavailable`   | Service unavailable for the specified currency |


---

# 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://docs.gluwa.com/api/balance.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.
