<blockquote>
  <p>My question is, how do I use the HTTP POST JSON RPC API back to my local bitcoin >instance to query for transactions? Is there a tutorial? </p>
</blockquote>

<p>You can find information about bitcoin RPC in <a href="https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs" rel="nofollow noreferrer">https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs</a></p>

<p>Also you can actually execute bitcoin RPC calls in <a href="https://chainquery.com/bitcoin-cli" rel="nofollow noreferrer">https://chainquery.com/bitcoin-cli</a>. If you only want to see what they are returning</p>

<blockquote>
  <p>I'd imagine I would be running in a continuous thread and periodically query >bitcoind (the daemon) for the latest batch of transactions. Is this possible?</p>
</blockquote>

<p>That's the approach I'm using in my project, you can see the code in <a href="https://github.com/JRamosGarcia/bitcoindAdapter" rel="nofollow noreferrer">https://github.com/JRamosGarcia/bitcoindAdapter</a> It uses many java technologies as spring (for many uses, but make RPC a breeze to implement) ,  or quartz for periodic jobs. It's a work in progress, but maybe you can find some code or technology that helps you.</p>

CC BY-SA 4.0
2020-02-26T09:20:34.103Z
2020-02-26T09:20:34.103Z
dev7ba
<p>Renlord commented</p>

<blockquote>
  <p>bitcoin transactions comes in streams, its better to use ZMQ for this. Read doc/zmq.md in the bitcoin repository</p>
</blockquote>

<p>and </p>

<blockquote>
  <p>[the data is not json but] serialized hex, you'll have to de-serialize it. There are convenient functions with bitcoin-cli to do this.</p>
</blockquote>

CC BY-SA 4.0
2018-11-14T09:50:15.560Z
2018-11-14T09:50:15.560Z
RedGrittyBrick
<p>I need to capture and store the raw transactions coming through my local full-node bitcoin instance. I read <a href="https://bitcoin.stackexchange.com/questions/24224/how-to-stream-transactions-on-the-network">here</a> that it is possible, but there is no mention of the particular RPC calls. I also see the <a href="https://en.bitcoin.it/wiki/Raw_Transactions#listunspent_.5Bminconf.3D1.5D_.5Bmaxconf.3D999999.5D" rel="nofollow noreferrer">raw transaction JSON-RPC API</a>, but it is still not clear how to use this to periodically query the raw transactions.</p>

<p>It seems like <a href="https://github.com/sebicas/bitcoin-sniffer/blob/master/sniffer.py" rel="nofollow noreferrer">bitcoin-sniffer</a> (written in python) is what I am trying to do and need, and since I am using Java, it seems <a href="https://bitcoinj.github.io/" rel="nofollow noreferrer">bitcoinj</a> can actually listen for incoming transactions, but I don't see example codes on how to do this.</p>

<p>My question is, how do I use the HTTP POST JSON RPC API back to my local bitcoin instance to query for transactions? Is there a tutorial? </p>

<p>I'd imagine I would be running in a continuous thread and periodically query bitcoind (the daemon) for the latest batch of transactions. Is this possible?</p>

CC BY-SA 3.0
2017-02-10T22:38:19.620Z
bitcoin transactions comes in streams, its better to use ZMQ for this. Read doc/zmq.md in the bitcoin repository.
rny
CC BY-SA 3.0
2017-02-10T22:45:04.827Z
Thanks. That seems like a viable alternative. Just to clarify, do you know if what's published from bitcoind to 0MQ is the raw transactions (the data and all its fields) in deserialized (JSON not hex) form?
Jane Wayne
CC BY-SA 3.0
2017-02-10T23:24:57.613Z
its serialized hex, you'll have to de-serialize it. There are convenient functions with bitcoin-cli to do this.
rny
<bitcoind><json-rpc><bitcoinj>
Which RPC may I use to query bitcoind for raw transactions coming through?
Jane Wayne
# Which RPC may I use to query bitcoind for raw transactions coming through?

(Asked by: username_0 on 2017-02-10)

I need to capture and store the raw transactions coming through my local full-node bitcoin instance. I read [here](https://bitcoin.stackexchange.com/questions/24224/how-to-stream-transactions-on-the-network) that it is possible, but there is no mention of the particular RPC calls. I also see the [raw transaction JSON-RPC API](https://en.bitcoin.it/wiki/Raw_Transactions#listunspent_.5Bminconf.3D1.5D_.5Bmaxconf.3D999999.5D), but it is still not clear how to use this to periodically query the raw transactions.

It seems like [bitcoin-sniffer](https://github.com/sebicas/bitcoin-sniffer/blob/master/sniffer.py) (written in python) is what I am trying to do and need, and since I am using Java, it seems [bitcoinj](https://bitcoinj.github.io/) can actually listen for incoming transactions, but I don't see example codes on how to do this.

My question is, how do I use the HTTP POST JSON RPC API back to my local bitcoin instance to query for transactions? Is there a tutorial?

I'd imagine I would be running in a continuous thread and periodically query bitcoind (the daemon) for the latest batch of transactions. Is this possible?

**Tags:** bitcoind, json-rpc, bitcoinj

> **Comments:**
> **username_1**: bitcoin transactions comes in streams, its better to use ZMQ for this. Read doc/zmq.md in the bitcoin repository.  
> **username_0**: Thanks. That seems like a viable alternative. Just to clarify, do you know if what's published from bitcoind to 0MQ is the raw transactions (the data and all its fields) in deserialized (JSON not hex) form?  
> **username_1**: its serialized hex, you'll have to de-serialize it. There are convenient functions with bitcoin-cli to do this.  

---

## 2 answers

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

> My question is, how do I use the HTTP POST JSON RPC API back to my local bitcoin >instance to query for transactions? Is there a tutorial?

You can find information about bitcoin RPC in <https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs>

Also you can actually execute bitcoin RPC calls in <https://chainquery.com/bitcoin-cli>. If you only want to see what they are returning

> I'd imagine I would be running in a continuous thread and periodically query >bitcoind (the daemon) for the latest batch of transactions. Is this possible?

That's the approach I'm using in my project, you can see the code in <https://github.com/JRamosGarcia/bitcoindAdapter> It uses many java technologies as spring (for many uses, but make RPC a breeze to implement) , or quartz for periodic jobs. It's a work in progress, but maybe you can find some code or technology that helps you.


---

### Answer by username_3 on 2018-11-14. Score: 0

Renlord commented

> bitcoin transactions comes in streams, its better to use ZMQ for this. Read doc/zmq.md in the bitcoin repository

and

> [the data is not json but] serialized hex, you'll have to de-serialize it. There are convenient functions with bitcoin-cli to do this.


---

