Bitcoin
Bitcoin
Bitcoin
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
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.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | height | number | 是 | Block height in the active chain. |
| 类型 | 描述 |
|---|---|
| string | Hex block hash at the given height. |
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-8 | Block height out of range | The requested height is negative or above the current tip height. |
-8, "Block height out of range".