<p>You can set up a bitcoin-core node to watch for new transactions, and notify you of them. </p>

<p>This is a preferable solution, since you won't have to trust anyone to supply you with the correct info (what if they lie, or are incorrect?), and you will retain your privacy (why dox yourself with respect to which addresses you are interested in, to the API provider and anyone else listening in on your connection?). </p>

<p>You can set the command <code>-walletnotify=&lt;cmd&gt;</code> in your bitcoin.conf file, and write a bash script to alert you of the transaction in question, in your preferred manner (write to a log file, send an alert email, blink a light, etc). </p>

<p>For a slightly more in-depth walkthrough of setting this up, see this question: <a href="https://bitcoin.stackexchange.com/questions/24457/how-do-i-use-walletnotify">How do I use walletnotify?</a></p>

CC BY-SA 4.0
2020-02-26T23:20:06.730Z
2020-02-26T23:20:06.730Z
chytrik
<p>On a bash shell prompt, assuming you have <code>curl</code> and <code>jq</code> installed:</p>



<pre><code>curl https://blockchain.info/rawaddr/1De2yKR7q95R1CV9PhmxA3kcYVa25mDaqj | jq -r '.txs | .[] | .hash' | head -1
</code></pre>

<p>This will give you the most recent txid this address has appeared in.</p>

CC BY-SA 4.0
2020-02-26T17:50:14.993Z
2020-02-26T17:50:14.993Z
thalisk
<p>How can I check if a bitcoin address received a new transaction programmatically?</p>

<p>Here is an example of the API call, but I can't figure out how to get the value of the new transation in API response:</p>

<p><a href="https://blockchain.info/rawaddr/1De2yKR7q95R1CV9PhmxA3kcYVa25mDaqj" rel="nofollow noreferrer">https://blockchain.info/rawaddr/1De2yKR7q95R1CV9PhmxA3kcYVa25mDaqj</a></p>

<blockchain>
How to check if a bitcoin address received a new transaction programmatically?
Richard Branson
# How to check if a bitcoin address received a new transaction programmatically?

(Asked by: username_0 on 2020-02-26)

How can I check if a bitcoin address received a new transaction programmatically?

Here is an example of the API call, but I can't figure out how to get the value of the new transation in API response:

<https://blockchain.info/rawaddr/1De2yKR7q95R1CV9PhmxA3kcYVa25mDaqj>

**Tags:** blockchain


---

## 2 answers

### Answer by username_1 on 2020-02-26. Score: 1

You can set up a bitcoin-core node to watch for new transactions, and notify you of them.

This is a preferable solution, since you won't have to trust anyone to supply you with the correct info (what if they lie, or are incorrect?), and you will retain your privacy (why dox yourself with respect to which addresses you are interested in, to the API provider and anyone else listening in on your connection?).

You can set the command `-walletnotify=` in your bitcoin.conf file, and write a bash script to alert you of the transaction in question, in your preferred manner (write to a log file, send an alert email, blink a light, etc).

For a slightly more in-depth walkthrough of setting this up, see this question: [How do I use walletnotify?](https://bitcoin.stackexchange.com/questions/24457/how-do-i-use-walletnotify)


---

### Answer by username_2 on 2020-02-26. Score: 0

On a bash shell prompt, assuming you have curl and jq installed:
curl https://blockchain.info/rawaddr/1De2yKR7q95R1CV9PhmxA3kcYVa25mDaqj | jq -r '.txs | .[] | .hash' | head -1

This will give you the most recent txid this address has appeared in.


---

