<p>Although I don't fully understand your question, I can tell you that you can get the hash of a block at height Happy using the <code>getblockhash</code> api call:</p>

<p><code>getblockhash 277586</code> </p>

<p>Will result in the block hash for the block on the main chain at height 277586.</p>

<p>Block Explorer.com provides an online api for this api call: <a href="http://blockexplorer.com/q/getblockhash" rel="nofollow">http://blockexplorer.com/q/getblockhash</a></p>

CC BY-SA 3.0
2014-01-04T09:35:18.310Z
As per your suggestion I tried the following...

http://blockexplorer.com/q/getblockhash/277586

But it is throwing the following Error...

ERROR: unknown (Most likely my bitcoind stopped working or this page is too large/complex.)

Hence, I was thinking if there could be some API call on blockchain.info rather than bloclexplorer.com, as it seems the former is more stable than the latter.
Midnight Engineer
CC BY-SA 3.0
2014-01-03T19:06:52.163Z
2014-01-03T19:06:52.163Z
Steven Roose
<p>Can anyone plz point out a way to derive the BlockHash from TxHash using API ?</p>

<p>Lets assume I am studying the following...</p>

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

<pre><code>{"block_height":277586,"time":1388338452,"inputs":[{"prev_out":{"n":0,"value":1683888660,"addr":"14RfKeVn9PrG4CLuyzJYUXiFdqyd7Amjp5","tx_index":102576735,"type":0}}],"vout_sz":2,"relayed_by":"178.194.214.181","hash":"5602487e624ee14193f646e29a9ac203335bc962b30155b66d142ab15f79018c","vin_sz":1,"tx_index":105080382,"ver":1,"out":[{"n":0,"value":1483888660,"addr":"1FxmczX5yUXn6GAZBCJy2Uc25NgzpQNEtM","tx_index":105080382,"spent":false,"type":0},{"n":1,"value":200000000,"addr":"1NbX8RDmNJ2J36LBTBgTU6bwcqdX7Udv2M","tx_index":105080382,"spent":true,"type":0}],"size":225}
</code></pre>

<p>I have <strong>"block_height":277586</strong></p>

<p>Now, how do I find out the block_hash of this ?</p>

<transactions><api><block>
TxHash to BlockHash using API
Midnight Engineer
# TxHash to BlockHash using API

(Asked by: username_0 on 2014-01-03)

Can anyone plz point out a way to derive the BlockHash from TxHash using API ?

Lets assume I am studying the following...

<https://blockchain.info/rawtx/5602487e624ee14193f646e29a9ac203335bc962b30155b66d142ab15f79018c>

```
{"block_height":277586,"time":1388338452,"inputs":[{"prev_out":{"n":0,"value":1683888660,"addr":"14RfKeVn9PrG4CLuyzJYUXiFdqyd7Amjp5","tx_index":102576735,"type":0}}],"vout_sz":2,"relayed_by":"178.194.214.181","hash":"5602487e624ee14193f646e29a9ac203335bc962b30155b66d142ab15f79018c","vin_sz":1,"tx_index":105080382,"ver":1,"out":[{"n":0,"value":1483888660,"addr":"1FxmczX5yUXn6GAZBCJy2Uc25NgzpQNEtM","tx_index":105080382,"spent":false,"type":0},{"n":1,"value":200000000,"addr":"1NbX8RDmNJ2J36LBTBgTU6bwcqdX7Udv2M","tx_index":105080382,"spent":true,"type":0}],"size":225}

```

I have **"block\_height":277586**

Now, how do I find out the block\_hash of this ?

**Tags:** transactions, api, block


---

## 1 answers

### Answer by username_1 on 2014-01-03. Score: 1

Although I don't fully understand your question, I can tell you that you can get the hash of a block at height Happy using the `getblockhash` api call:

`getblockhash 277586`

Will result in the block hash for the block on the main chain at height 277586.

Block Explorer.com provides an online api for this api call: <http://blockexplorer.com/q/getblockhash>

> **Comments:**
> **username_0**: As per your suggestion I tried the following...  http://blockexplorer.com/q/getblockhash/277586  But it is throwing the following Error...  ERROR: unknown (Most likely my bitcoind stopped working or this page is too large/complex.)  Hence, I was thinking if there could be some API call on blockchain.info rather than bloclexplorer.com, as it seems the former is more stable than the latter.  

---

