<p><code>bitcoind</code> does not have an index by spending/receiving address.</p>
<p>to get transaction by address a different index is needed, examples are electrum server and reimplementations of it (electrumX, electrs), these do require extra storage for their own index.</p>
<p>I personally have a good experience with electrs (<a href="https://github.com/romanz/electrs" rel="nofollow noreferrer">github</a>), it only takes up ~10% of the blockchain size and is fast with queries.</p>

CC BY-SA 4.0
2022-02-05T13:28:18.000Z
Thank you. `contrib/history.sh` in the electrs repository is a good starting point and gives exactly the information I need!
C-Otto
CC BY-SA 4.0
2022-02-04T18:31:55.730Z
2022-02-04T18:31:55.730Z
Antoni
<p>I develop an application (BitBook, <a href="https://github.com/C-Otto/BitBook" rel="nofollow noreferrer">https://github.com/C-Otto/BitBook</a>) that helps users track their coins. For this, whenever I reason about some address, I need to consider all transactions that take funds <em>out of</em> the address, or pay <em>into</em> the address.</p>
<p>With bitcoin-cli I could use the block details (possibly with <code>getblockfilter</code>) to find all transactions that pay <em>into</em> the address. By adding quite a bit of logic and scanning the complete blockchain, I could then also find addresses that take funds <em>out of</em> the address. However, the whole process seems rather involved and slow.</p>
<p>APIs like Blockchair offer convenient endpoints that give me exactly the required information, but considering that I need to keep this information up-to-date (for all addresses that are relevant to the user), I'd like to avoid using such APIs that only offer a limited number of free requests. Aside from that, there's the obvious privacy issue.</p>
<p>My question:</p>
<p>What are other ways to get the necessary information?</p>
<ul>
<li>Input: address</li>
<li>Output: list of transactions paying into the address or taking out of the address</li>
</ul>

<bitcoin-core><address><api><bitcoin-cli>
Get transactions for address
C-Otto
# Get transactions for address

(Asked by: username_0 on 2022-02-04)

I develop an application (BitBook, <https://github.com/username_0/BitBook>) that helps users track their coins. For this, whenever I reason about some address, I need to consider all transactions that take funds *out of* the address, or pay *into* the address.

With bitcoin-cli I could use the block details (possibly with `getblockfilter`) to find all transactions that pay *into* the address. By adding quite a bit of logic and scanning the complete blockchain, I could then also find addresses that take funds *out of* the address. However, the whole process seems rather involved and slow.

APIs like Blockchair offer convenient endpoints that give me exactly the required information, but considering that I need to keep this information up-to-date (for all addresses that are relevant to the user), I'd like to avoid using such APIs that only offer a limited number of free requests. Aside from that, there's the obvious privacy issue.

My question:

What are other ways to get the necessary information?

* Input: address
* Output: list of transactions paying into the address or taking out of the address

**Tags:** bitcoin-core, address, api, bitcoin-cli


---

## 1 answers

### Answer by username_1 on 2022-02-04. Score: 4 | Accepted answer

`bitcoind` does not have an index by spending/receiving address.

to get transaction by address a different index is needed, examples are electrum server and reimplementations of it (electrumX, electrs), these do require extra storage for their own index.

I personally have a good experience with electrs ([github](https://github.com/romanz/electrs)), it only takes up ~10% of the blockchain size and is fast with queries.

> **Comments:**
> **username_0**: Thank you. `contrib/history.sh` in the electrs repository is a good starting point and gives exactly the information I need!  

---

