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 ?

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

1
  • As per your suggestion I tried the following... 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. Jan 4 '14 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.