How to get the list of blockheader I know that i can use getheader 'hash' from bitcoin core, but i can't use it for all blocks, it's time consuming.
Is there a site where i can find all bitcoin blockheader? Like a blockchain site but shows the blockheader?
Help is appreciated, thank you
You can take advantage of Blockchain.com's API (formerly Blockchain.info).
You can access BTC blocks based on their block height via a URL of the form https://blockchain.info/rawblock/&lt;height+1&gt;. We use &lt;height+1&gt; because 1 is used as the index of the genesis block, which is instead usually referred to as block 0, as it is defined to have a height of 0.
By default, this endpoint provides a JSON dump of the data in the block, but you can get the raw block data as a hexadecimal string instead by appending the query string ?format=hex. For example, https://blockchain.info/rawblock/2?format=hex will give you the data in the block after the genesis block (the block with height 1) as a hexadecimal string.
The block header is 80 bytes, or 160 nibbles (hexadecimal characters), so you can e.g. use curl to fetch the data, and then head to truncate it to just the header, and then save that hex string to a file:
curl 'https://blockchain.info/rawblock/2?format=hex' | head -c 160 &gt; block-1.txt

You can use a simple Bash script to automate this for all blocks:
#!/bin/bash

latest_block_height=670288

for ((i=0; i &lt;= latest_block_height; i++)); do
    if ! [ -f &quot;block-$i.txt&quot; ]; then
        curl 'https://blockchain.info/rawblock/'&quot;$(($i + 1))&quot;'?format=hex' | head -c 160 &gt; &quot;block-$i.txt&quot;
    fi
    echo &quot;Downloaded block $i.&quot;
done