<p>I think your should consider that using an API could result in fakes, wrongly-validated data. Using an API means you fully trust the API service,... which is kind-of against bitcoin no-trust model.</p>

<p>I recommend you to run a full node (Bitcoin Core 0.13.2 during time of writing).</p>

<p>There is no address-index (there is a patch you can manually compile into Core).</p>

<p>Simplest way with standard Bitcoin-Core 0.13.2 is to import all your addresses as <strong>watch-only</strong> into a wallet.</p>

<h2>import addresses</h2>

<p>Use the RPC call <code>importaddress &lt;address&gt; "" false</code> to import a watch only address.</p>

<p>The 3rd argument <code>false</code> is required to not rescan the blockchain for each import (can take serval hours).</p>

<p>Once you have imported all addresses, stop bitcoind/qt and restart it with the startup argument <code>-rescan</code>.</p>

<p>The rescan may take a couple of minutes/hours (depending on your Disk/RAM/CPU). Once done, you can call <code>getreceivedbyaddress &lt;addr&gt;</code> for each address to get the balance.</p>

<p><strong>This result in authentic, self-validated data.</strong></p>

<p><strong>Note:</strong> If you are using Bitcoin Core 0.14, consider importing multiple addresses with <code>importmulti</code></p>

CC BY-SA 3.0
2017-01-18T11:10:17.263Z
Hi, thanks for your answer, but this method is not very effective if the addresses list change every run, because each run I need to go through this process that can take some time. If I'm running full node, I should have access to all data on the blockchain, no? No convenient way to access this data?
bl0ck3d
CC BY-SA 3.0
2017-01-19T17:18:21.467Z
Then you need an address index. Either look at the existing Core patches (There is a pull request for Bitcoin Core) or try to use existing alternatives (Bitpays Insight [based on Bitcoin Core])
Jonas Schnelli
CC BY-SA 3.0
2017-01-18T07:31:23.510Z
2017-01-18T07:31:23.510Z
Jonas Schnelli
<p>Have you tried <a href="https://www.blockonomics.co/views/api.html" rel="nofollow noreferrer">blockonomics api</a> . Their free plans allow 50 addresses at once and paid one <a href="https://www.blockonomics.co/views/faqs.html#merchant-queries" rel="nofollow noreferrer">upto 8000</a></p>

<p>If you want to run your own node. I would recommend running <a href="https://github.com/bitcoin-abe/bitcoin-abe" rel="nofollow noreferrer">abe blockexplorer</a> along with your node. Core wallet and other SPV wallets like electrum have known to become sluggish with <a href="https://www.blockonomics.co/views/faqs.html#merchant-queries" rel="nofollow noreferrer">large number of addresses</a> </p>

CC BY-SA 3.0
2017-01-18T04:19:25.050Z
2017-01-18T04:19:25.050Z
dark knight
<p>What is the best way to get balance of large amount of addresses?
I tried to use APIs from different providers, but they are limiting the requests. Is there any APIs that give premium service without limiting requests?</p>

<p>Or maybe should I run full node, and use it?
If yes, how I'm using the full node to get the addresses balances? I'm using Ruby on Rails.</p>

<p>Thanks.</p>

CC BY-SA 3.0
2017-01-18T01:49:40.947Z
Possible duplicate of [How to index the UTXO set efficiently?](http://bitcoin.stackexchange.com/questions/30884/how-to-index-the-utxo-set-efficiently)
m1xolyd1an
<address><balance><ruby>
How to get balance of tens of thousands of addresses?
bl0ck3d
# How to get balance of tens of thousands of addresses?

(Asked by: username_0 on 2017-01-17)

What is the best way to get balance of large amount of addresses?
I tried to use APIs from different providers, but they are limiting the requests. Is there any APIs that give premium service without limiting requests?

Or maybe should I run full node, and use it?
If yes, how I'm using the full node to get the addresses balances? I'm using Ruby on Rails.

Thanks.

**Tags:** address, balance, ruby

> **Comments:**
> **username_1**: Possible duplicate of [How to index the UTXO set efficiently?](http://bitcoin.stackexchange.com/questions/30884/how-to-index-the-utxo-set-efficiently)  

---

## 2 answers

### Answer by username_2 on 2017-01-18. Score: 4

I think your should consider that using an API could result in fakes, wrongly-validated data. Using an API means you fully trust the API service,... which is kind-of against bitcoin no-trust model.

I recommend you to run a full node (Bitcoin Core 0.13.2 during time of writing).

There is no address-index (there is a patch you can manually compile into Core).

Simplest way with standard Bitcoin-Core 0.13.2 is to import all your addresses as **watch-only** into a wallet.

## import addresses

Use the RPC call `importaddress  "" false` to import a watch only address.

The 3rd argument `false` is required to not rescan the blockchain for each import (can take serval hours).

Once you have imported all addresses, stop bitcoind/qt and restart it with the startup argument `-rescan`.

The rescan may take a couple of minutes/hours (depending on your Disk/RAM/CPU). Once done, you can call `getreceivedbyaddress`  for each address to get the balance.

**This result in authentic, self-validated data.**

**Note:** If you are using Bitcoin Core 0.14, consider importing multiple addresses with `importmulti`

> **Comments:**
> **username_0**: Hi, thanks for your answer, but this method is not very effective if the addresses list change every run, because each run I need to go through this process that can take some time. If I'm running full node, I should have access to all data on the blockchain, no? No convenient way to access this data?  
> **username_2**: Then you need an address index. Either look at the existing Core patches (There is a pull request for Bitcoin Core) or try to use existing alternatives (Bitpays Insight [based on Bitcoin Core])  

---

### Answer by username_3 on 2017-01-18. Score: -2

Have you tried [blockonomics api](https://www.blockonomics.co/views/api.html) . Their free plans allow 50 addresses at once and paid one [upto 8000](https://www.blockonomics.co/views/faqs.html#merchant-queries)

If you want to run your own node. I would recommend running [abe blockexplorer](https://github.com/bitcoin-abe/bitcoin-abe) along with your node. Core wallet and other SPV wallets like electrum have known to become sluggish with [large number of addresses](https://www.blockonomics.co/views/faqs.html#merchant-queries)


---

