Get balance of multiple address

I’ve made a cronjob that checks the balance on the address of my users and store it inside my mysql database to let me sort them by balance. The cronjob runs a script that gets the balance of each user one by one (using web3js) so it’s going to make a lot of infura api calls and I will reach my limit very soon… is there a way to get balance of multiple addresses in one single call? and the api call limit is it per seconds or is it only daily?

Hi @brincy and welcome to our community site!

I am not aware of a way to get the balance for multiple addresses using one RPC call. How frequently is your cronjob and how many balances are you querying?

Regarding the call limits, those are on a daily basis though there are bursting limits so I would recommend building in a little metering of requests in your cronjob.

Hope this helps,

Hey @brincy you’ll want to read this article on Ethereum transaction subscriptions, and use web3.eth.subscribe to watch each new block for transfer events of the accounts you care about.