# How to get the token holders at a range and their addresses

**URL:** <https://community.bitquery.io/t/how-to-get-the-token-holders-at-a-range-and-their-addresses/1667>\
**Category:** GraphQL API\
**Created:** [September 10, 2023, 10:36am UTC](https://community.bitquery.io/t/how-to-get-the-token-holders-at-a-range-and-their-addresses/1667 "2023-09-10T10:36:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoFace](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@NoFace](https://community.bitquery.io/u/NoFace)\
**Post date:** [September 10, 2023, 10:36am UTC](https://community.bitquery.io/t/how-to-get-the-token-holders-at-a-range-and-their-addresses/1667/1 "2023-09-10T10:36:21Z")

</div>

I saw this [Token Holders API | Streaming API (V2 API Docs)](https://docs.bitquery.io/docs/examples/balances/tokenHolders-api/)

its similar to what I need, I need to specify a range and get the token holders by the hour or day in that range.

I need to return the address and balance of each, making sure the data is organized by the range (assuming a holder can hold different positions at different times)

TY

---

<div class="post-metadata">

**Author:** ![Divya](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Divya](https://community.bitquery.io/u/Divya)\
**Post date:** [September 12, 2023, 3:42pm UTC](https://community.bitquery.io/t/how-to-get-the-token-holders-at-a-range-and-their-addresses/1667/2 "2023-09-12T15:42:30Z")

</div>

It’s the same query modified with `date` range… Here’s an example (with date as sorting field)

```auto
query MyQuery {
  EVM(dataset: combined, network: eth) {
    BalanceUpdates(
      orderBy: {descending: Block_Date}
      limit: {count: 30}
      where: {Currency: {SmartContract: {is: "0x5Af0D9827E0c53E4799BB226655A1de152A425a5"}}, Block: {Date: {after: "2023-02-01", before: "2023-02-05"}}}
    ) {
      BalanceUpdate {
        Address
      }
      Balance: sum(of: BalanceUpdate_Amount, selectWhere: {gt: "0"})
      Block {
        Date
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![NoFace](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@NoFace](https://community.bitquery.io/u/NoFace)\
**Post date:** [September 17, 2023, 1:22pm UTC](https://community.bitquery.io/t/how-to-get-the-token-holders-at-a-range-and-their-addresses/1667/3 "2023-09-17T13:22:39Z")

</div>

it doesnt work, cant run gives a silent error

---

<div class="post-metadata">

**Author:** ![NoFace](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@NoFace](https://community.bitquery.io/u/NoFace)\
**Post date:** [September 17, 2023, 1:28pm UTC](https://community.bitquery.io/t/how-to-get-the-token-holders-at-a-range-and-their-addresses/1667/4 "2023-09-17T13:28:21Z")

</div>

works now changed the endpoint

---

<div class="post-metadata">

**Author:** ![NoFace](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@NoFace](https://community.bitquery.io/u/NoFace)\
**Post date:** [September 17, 2023, 1:37pm UTC](https://community.bitquery.io/t/how-to-get-the-token-holders-at-a-range-and-their-addresses/1667/5 "2023-09-17T13:37:37Z")

</div>

would this work? is this retrieving all the wallets and their balances, on an hourly for that day?

query MyQuery {  
EVM(dataset: combined, network: eth) {  
BalanceUpdates(  
orderBy: {descending: Block\_Date}  
limit: {count: 30}  
where: {Currency: {SmartContract: {is: “0x5579699a6e1da7d924d3bfde38a427be5fc93812”}}, Block: {Date: {is: “2023-09-16”}}}  
) {  
BalanceUpdate {  
Address  
}  
Balance: sum(of: BalanceUpdate\_Amount, selectWhere: {gt: “0”})  
Block {  
Date(interval: {})  
Time(interval: {count: 24})  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![NoFace](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@NoFace](https://community.bitquery.io/u/NoFace)\
**Post date:** [September 17, 2023, 5:41pm UTC](https://community.bitquery.io/t/how-to-get-the-token-holders-at-a-range-and-their-addresses/1667/6 "2023-09-17T17:41:35Z")

</div>

Im afraid this only gives balanceupdates, what if I want a spanshot of balances?
