TxHash to BlockHash using API

0

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 ?

Midnight Engineer

Posted 2014-01-03T10:32:16.597

Reputation: 79

Answers

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

Steven Roose

Posted 2014-01-03T10:32:16.597

Reputation: 10 855

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 2014-01-04T09:35:18.310