> For the complete documentation index, see [llms.txt](https://docs.bitcoin-balance-api.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bitcoin-balance-api.com/endpoints/balance.md).

# Balance

## Make a request (mainnet)

For mainnet a valid apikey is needed and needs to be send as a query parameter. You can [create a temporary mainnet api key](https://api.bitcoin-balance-api.com/keys) for testing the api. The correct url for mainnet is:

```
https://api.bitcoin-balance-api.com/v1/address/34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo?apikey=$SECRET
```

Where `$SECRET` needs to be replaced with your own apikey.

## Response

The response from the api contains two fields, `status` and `balance`. When status is `200` the request was successful and it will contain the value in the `balance` field. E.g.:

```json
{ "status": 200, "balance": 19989726659 }
```

The `status` field can contain different responses like [400, 401, 404, 422 or 500](/error-codes.md) depending on the request.

### Balance Calculation

The `balance` is in satoshi's and if you want to change it to BTC, it needs to be divided by **100000000**. E.g.:

```python
# Python Example
balance=7821967447
balance_btc=balance/100000000
print(f'Balance in Bitcoin: %s' % (balance_btc))
```


---

# 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 dynamically by asking a question.

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

```
GET https://docs.bitcoin-balance-api.com/endpoints/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.
