Get current wallet balance of all holders for a bsc network token

I’ve been following the development of bitquery for a while now and attempted to gather the current balance of all the holders of a token similar to bscscan balances page.

Here’s for example the balances page of SafeMoon:

My understanding is that the balances API had some issues and it was turned off. Is there another API that I can use to get to this info?

Would appreciate an example query.

Here’s for example a way to get the balance of a single address on the bsc network for safemoon.
How would I get the balances of all wallets in the same query?

query MyQuery {
  ethereum(network: bsc) {
    address(
      address: {in: ["0x0000000000000000000000000000000000000001"]}
  
    ) {
      address
      balances(currency: { in: ["0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3"]}) {
        currency {
          address
          symbol
        }
        value
      }
    }
  }
}

Hi @Cocili to get all the balance of more than 1 address in the same query, you can use the following query where 3 example addresses have been placed instead of 1.

query MyQuery {
  ethereum(network: bsc) {
    address(
      address: {in: [
        "0x0000000000000000000000000000000000000001",
        "0x8c128dba2cb66399341aa877315be1054be75da8",
        "0x79c4af7c43f500b9ccba9396d079cc03dfcafda1"
      ]}
    ) {
      address
      balances(currency: { in: ["0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3"]}) {
        currency {
          address
          symbol
        }
        value
      }
    }
  }
}

Thanks @sayon but I know I can list more than 1 address by separating it with a comma.

My question was how to get the balances of “ALL” holders. I can’t manually write 2.5 million addresses.

Very true. So in order to get the addresses you can do one thing. Using the following query, you can find out the available addresses for the currency address

{
  ethereum(network: bsc){
    dexTrades(
      options: {limit: 10}
      buyCurrency: {is: "0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3"}
    ){
      address{
        address
      }
    }
  }
}

and then, you can make the returned address pass through the original query using variables as shown in the below query.