4
1
On blockchain's blockchain api documentation, located here
https://blockchain.info/api/blockchain_api
There is an api call that uses a parameter called block_index. What is this value, and how does it differ from block_height? From playing around with changing the block_index value in the following api call:
https://blockchain.info/block-index/$block_index?format=json
It seems like (imo quite arbitrarily, which adds to my confusion) that block_index 14849 corresponds to the genesis block. Finally, on the api page listed at the top the first example output they show gives a block whose index is 818044, yet when I enter the following api call into my browser's address bar:
https://blockchain.info/block-index/818044?format=json
I get "Block Not Found". Is this just a bug in blockchain.info that the example output they provide doesn't actually work, or am I using block_index incorrectly?
This answer is very poor, as you are repeating my question back to me. Also did you even follow your own link? That API call returns information about block 248899, which is not even close to the latest block as a quick check to the blockchain homepage shows we are beyond block height 300000. Please explain what point you were trying to make. – almel – 2014-07-18T05:59:33.203
My bad, the link is for a block that was back in 28 Jul 2013 14:57:27 GMT. Basically my take is that block height is the block id in the main block chain, but block index is the index number in blockchain.info database, as amaclin mentioned they might be two different transaction ids (or also double spends) that one of them would end up in the main blockchain, so the block-index is always higher than the height (maybe the same in the first few blocks, haven't checked) – Shayan – 2014-07-19T07:27:06.410