# Wrong data of a address balance

**URL:** <https://community.bitquery.io/t/wrong-data-of-a-address-balance/1836>\
**Category:** GraphQL API\
**Created:** [March 3, 2024, 3:05am UTC](https://community.bitquery.io/t/wrong-data-of-a-address-balance/1836 "2024-03-03T03:05:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mars.liu](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/mars.liu/32/873_2.png) [@mars.liu](https://community.bitquery.io/u/mars.liu)\
**Post date:** [March 3, 2024, 3:05am UTC](https://community.bitquery.io/t/wrong-data-of-a-address-balance/1836/1 "2024-03-03T03:05:04Z")

</div>

There is a inaccurate data of a btc address balance:

```graphql
query MyQuery {
  bitcoin {
    addressStats(address: {in: ["3NLi7b5o1nuNT3igSXPWhD6UrEYqopAooy"]}) {
      address {
        address
        balance
      }
    }
  }
}

```

got

```json
{
  "bitcoin": {
    "addressStats": [
      {
        "address": {
          "address": "3NLi7b5o1nuNT3igSXPWhD6UrEYqopAooy",
          "balance": -57.33549519999997
        }
      }
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![GkM8t](https://avatars.discourse-cdn.com/v4/letter/g/45deac/32.png) [@GkM8t](https://community.bitquery.io/u/GkM8t)\
**Post date:** [March 5, 2024, 8:22am UTC](https://community.bitquery.io/t/wrong-data-of-a-address-balance/1836/2 "2024-03-05T08:22:51Z")

</div>

Hi @mars.liu . The accuracy of the balances for a UTXO account can sometimes be unreliable when using the addressStats API. Instead, a more dependable approach involves utilizing the bitcoin input and output API to calculate the balance of a BTC address by subtracting the bitcoin output value from the bitcoin input value.  
Reference to the below example query for the same.

> Output → value - Input → value = Balance

> **[BTC\_Address\_Balance - Blockchain Data API](https://ide.bitquery.io/BTC_Address_Balance)**
>
> Bitquery is analytical engine for blockchains
