Bitcoin
Bitcoin
Bitcoin
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
getrawtransaction looks up a Bitcoin transaction by its txid and returns it either as the raw serialized hex or, when verbose is set, as a decoded JSON object with vin[], vout[], BTC output amounts, and — once the transaction is confirmed — its blockhash, confirmations, and blocktime. At verbosity 2 (Bitcoin Core 24.0+) it additionally reports the fee and the prevout of each spent input. This is the standard way to fetch and inspect a confirmed payment on the Bitcoin network. Send the request to the Bitcoin JSON-RPC endpoint at https://bitcoin.therpc.io/YOUR_API_KEY.
txid, passing true (or 1) to get the JSON form instead of raw hex.vout address and amount, to confirm a deposit was received.2, avoiding extra lookups per input.gettxout can no longer return — since getrawtransaction reads the full historical transaction.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | txid | string | Sí | Transaction id. |
| 2 | verbose | boolean | number | No | false/0 = hex; true/1 = JSON object; 2 = object including fee and prevout per input (Core 24.0+).Predeterminado: false |
| 3 | blockhash | string | No | Block to look in; lets you fetch without -txindex when you know the block. |
| Tipo | Descripción |
|---|---|
| object | Hex string, or object: txid, hash, version, size, vsize, weight, locktime, vin[], vout[], hex; plus blockhash, confirmations, time, blocktime when confirmed; fee and prevout at verbosity 2. |
| Código | Mensaje | Causa |
|---|---|---|
-5 | No such mempool or blockchain transaction | The txid is unknown to this node. For arbitrary historical txs the node must run -txindex, or you must pass the blockhash. |
-8 | Invalid parameter | A parameter is out of range or the wrong shape — check verbosity levels, conf_target bounds, and required fields. |
-txindex, a node can only resolve transactions in its mempool or ones whose blockhash you pass explicitly; arbitrary historical txids return error -5. Most public providers run -txindex, but not all, so pass the blockhash when you have it.hash (wtxid) differs from the txid, and vsize differs from size. Use txid for identity and vsize for fee-rate math.2, which adds fee and per-input prevout, requires Bitcoin Core 24.0 or newer; older nodes only support false/0 and true/1.