<p>You can use JSON-RPC to achieve this. The only missing information will be the <strong>relayed_by</strong> field.</p>

<p>To use the JSON-RPC API of your client edit your bitcoin.conf file like this</p>

<pre><code>rpcuser=user 
rpcpassword=password 
rpcport=8332
server=1
</code></pre>

<p>Then you can use a library to query the API like <a href="http://jsonrpcphp.org" rel="nofollow">JSON-RPC for PHP</a></p>

<p>You can also do it on a much easier way by using the command line</p>

<pre><code>./bitcoind getblock c15f762e8dbbdd407534047ef2a9211ca0e79c3625d5fe73cdacade4f9118d6
</code></pre>

CC BY-SA 3.0
2013-12-15T22:35:11.040Z
2013-12-15T22:35:11.040Z
Jan Moritz
<p>Blockchain.info provides this functionality in a simple API like so:</p>

<p><a href="https://blockchain.info/rawtx/fc15f762e8dbbdd407534047ef2a9211ca0e79c3625d5fe73cdacade4f9118d6" rel="nofollow">https://blockchain.info/rawtx/fc15f762e8dbbdd407534047ef2a9211ca0e79c3625d5fe73cdacade4f9118d6</a></p>

<p>However, I would prefer to make this query directly against the network blockchain rather than to a third party like blockchain.info.</p>

<transactions><hash>
Is there any way to directly query the block chain for the body of a transaction given its hash?
Steven Zeiler
# Is there any way to directly query the block chain for the body of a transaction given its hash?

(Asked by: username_0 on 2013-12-15)

Blockchain.info provides this functionality in a simple API like so:

<https://blockchain.info/rawtx/fc15f762e8dbbdd407534047ef2a9211ca0e79c3625d5fe73cdacade4f9118d6>

However, I would prefer to make this query directly against the network blockchain rather than to a third party like blockchain.info.

**Tags:** transactions, hash


---

## 1 answers

### Answer by username_1 on 2013-12-15. Score: 1 | Accepted answer

You can use JSON-RPC to achieve this. The only missing information will be the **relayed\_by** field.

To use the JSON-RPC API of your client edit your bitcoin.conf file like this

```
rpcuser=user 
rpcpassword=password 
rpcport=8332
server=1

```

Then you can use a library to query the API like [JSON-RPC for PHP](http://jsonrpcphp.org)

You can also do it on a much easier way by using the command line

```
./bitcoind getblock c15f762e8dbbdd407534047ef2a9211ca0e79c3625d5fe73cdacade4f9118d6

```


---

