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

CC BY-SA 3.0
2014-09-14T14:15:09.913Z
How does blocktrail handle competing valid blocks then? Pick one, then reorganize when it is detached?
Murch
CC BY-SA 3.0
2014-09-18T09:48:13.413Z
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).
Ruben de Vries
CC BY-SA 3.0
2014-09-14T12:34:17.467Z
2014-09-14T12:34:17.467Z
Ruben de Vries
<p>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 <code>id ≥ height</code>.</p>

<p>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.</p>

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

CC BY-SA 3.0
2014-09-14T10:43:32.213Z
2014-09-14T10:43:32.213Z
Murch
<p>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. </p>

<p>Eg: For block 273294 the url is <a href="https://blockchain.info/block-index/335666" rel="nofollow">https://blockchain.info/block-index/335666</a> which contains the number 335666 instead of 273294. So how to convert 273294 to 335666.</p>

<p>Any help in conversion is appreciated.
Regards   </p>

<blockchain><blockchain.info>
How to get correct block details url with block height on blockchain.info
ak111in
# How to get correct block details url with block height on blockchain.info

(Asked by: username_0 on 2014-09-14)

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

**Tags:** blockchain, blockchain.info


---

## 2 answers

### Answer by username_2 on 2014-09-14. Score: 3 | Accepted answer

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.


---

### Answer by username_1 on 2014-09-14. Score: 0

<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 ;)

> **Comments:**
> **username_2**: How does blocktrail handle competing valid blocks then? Pick one, then reorganize when it is detached?  
> **username_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).  

---

