Bitcoin
Bitcoin
Bitcoin
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
getblock returns the contents of a Bitcoin block identified by its hash, and a verbosity argument lets you choose exactly how much detail you pay for: 0 gives the raw serialized block as hex, 1 gives a decoded object with the list of txids, 2 expands every transaction into a full object with fee data, and 3 (Bitcoin Core 25.0+) adds the spent prevout — value and script — for each input. This is the workhorse for reading the BTC transactions packed into a block roughly every ten minutes. Send the block hash and your chosen verbosity as positional parameters to https://bitcoin.therpc.io/YOUR_API_KEY.
| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | blockhash | string | Sim | Hash of the block. |
| 2 | verbosity | number | Não | 0 = hex; 1 = object with txids; 2 = object with full tx objects + fee; 3 = like 2 plus prevout per input (Core 25.0+).Padrão: 1 |
| Tipo | Descrição |
|---|---|
| object | Verbosity ≥1: hash, confirmations, size, strippedsize, weight, height, version, merkleroot, tx, time, mediantime, nonce, bits, difficulty, chainwork, nTx, previousblockhash, nextblockhash. Verbosity 0: serialized hex string. |
| Código | Mensagem | Causa |
|---|---|---|
-5 | Block not found | No block matches the given hash — check the hash and that the block is on the chain this endpoint serves. |
-8 | Invalid parameter | A parameter is out of range or the wrong shape — check verbosity levels, conf_target bounds, and required fields. |
getblockhash first.