I need to generate urls to block details page of blockchain.info when I have block height as input but cant find the relationship between block height and the number they are using in the url.

Eg: For block 273294 the url is https://blockchain.info/block-index/335666 which contains the number 335666 instead of 273294. So how to convert 273294 to 335666.

Any help in conversion is appreciated. Regards


It seems to me that Blockchain.info just increments the id of blocks whenever it sees a new one. If that is the case, the id of a block on Blockchain.info would just be an arbitrary number and the only relation that it has to the block height would be id ≥ height.

This is so, because it is possible that more than one successor to a block is found at roughly the same time. If that happens all successors (usually not more than two) will have the same block height, and are competitors to build the chain with the most accumulated work, "the longest" or main chain. This conflict will be resolved, when one chain gains another successor, pulling ahead of its competitors. However, Blockchain.info will still store the detached blocks, allowing the id to grow quicker than the block height.

Apparently, Blockchain.info gives an overview of blocks at the same height under the URL https://blockchain.info/block-height/<height>. There it lists the hash of the main chain block, which you could use to lookup the id.


https://www.blocktrail.com/block/273294 height or hash, works either way, no complicated things with internal IDs in the url and having 3 different pages for displaying a block ;)

  • How does blocktrail handle competing valid blocks then? Pick one, then reorganize when it is detached?
    – Murch
    Sep 14 '14 at 14:15
  • 1
    yes, we reorg just like a normal node does. we do keep the old orphans around (and within the next week a UI adjustment will be made to display 'blocks at the same height' in a nice way). Sep 18 '14 at 9:48

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.