Bitcoin
Bitcoin
Bitcoin
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
getblockhash takes a block height and returns the hex hash of the block at that position on Bitcoin's active chain. Most Bitcoin block RPCs — getblock, getblockheader, getblockstats — are keyed by hash rather than height, so this method is the bridge that turns a human-friendly height (the genesis block is 0, and each later block adds another ~10 minutes of BTC settlement) into the hash those calls expect. Send the request to https://bitcoin.therpc.io/YOUR_API_KEY with the height as the single positional parameter.
getblock or getblockheader.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | height | number | Sim | Block height in the active chain. |
| Tipo | Descrição |
|---|---|
| string | Hex block hash at the given height. |
| Código | Mensagem | Causa |
|---|---|---|
-8 | Block height out of range | The requested height is negative or above the current tip height. |
-8, "Block height out of range".