Bitcoin
Bitcoin
Bitcoin
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
getblockheader returns just the header of a Bitcoin block identified by its hash — the small fixed-size record that carries the version, previous and Merkle-root hashes, timestamp, difficulty bits, and nonce that Proof-of-Work commits to. With the verbose flag true (the default) you get a decoded JSON object including height, confirmations, and the neighbouring block hashes; with it false you get the serialized 80-byte header as a hex string. Because it skips every transaction in the BTC block body, it is far lighter than getblock. Call it at https://bitcoin.therpc.io/YOUR_API_KEY with the block hash as the first positional argument.
bits, nonce, Merkle root — without downloading the full block body.previousblockhash and nextblockhash to walk the chain cheaply, header by header.time and confirmations to age a transaction or display block timing.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | blockhash | string | نعم | Hash of the block. |
| 2 | verbose | boolean | لا | true = JSON object; false = serialized hex header.الافتراضي: true |
| النوع | الوصف |
|---|---|
| object | Verbose: hash, confirmations, height, version, versionHex, merkleroot, time, mediantime, nonce, bits, difficulty, chainwork, nTx, previousblockhash, nextblockhash. Non-verbose: hex string. |
| الكود | الرسالة | السبب |
|---|---|---|
-5 | Block not found | No block matches the given hash — check the hash and that the block is on the chain this endpoint serves. |
getblock, so reach for it whenever you only need header fields and not the transaction list.verbose to false only when you genuinely want the raw 80-byte hex header for hashing or verification — otherwise leave it true and read the decoded JSON.