Bitcoin (BTC) JSON-RPC API

The Bitcoin (BTC) JSON-RPC API exposes the Bitcoin Core node interface: methods for reading blocks, transactions, and UTXOs, inspecting the mempool, building and broadcasting raw transactions, working with PSBTs, and estimating fees. Requests POST a JSON-RPC 2.0 body to the endpoint; the method is selected by the body.

Base URL

bashhttps://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

Available API Methods

GetBlock provides access to Bitcoin Core JSON-RPC methods. Methods that require wallet or node-administration privileges are not available on shared endpoints and are omitted below.

Blockchain Methods

MethodDescription
getbestblockhashReturns the hash of the best (tip) block in the most-work fully-validated chain
getblockReturns information about a block given its hash
getblockchaininfoReturns an object with state information about blockchain processing, including the chain, height, best block hash, difficulty, verification progress, and softfork status
getblockcountReturns the height of the most-work fully-validated chain
getblockhashReturns the hash of the block at the given height in the best-block chain
getblockheaderReturns the block header for a given block hash
getblockstatsComputes per-block statistics for a given block, identified by hash or height
getchaintipsReturns information about all known tips in the block tree, including the main chain and any orphaned branches
getchaintxstatsComputes statistics about the total number and rate of transactions in the chain over a window of blocks ending at a given block
getdifficultyReturns the proof-of-work difficulty as a multiple of the minimum difficulty
getindexinfoReturns the status of the optional block indexes, such as the transaction index and the coinstats index, including whether each is synced and its best block height
gettxoutReturns details about an unspent transaction output (utxo)
gettxoutproofReturns a hex-encoded proof that one or more transactions were included in a block
preciousblockTreats a block as if it were received before others with the same work, changing tip selection

Mempool Methods

MethodDescription
getmempoolinfoReturns details about the active state of the transaction memory pool, including the number of transactions, total size, and minimum fee rate
getrawmempoolReturns the transaction ids in the memory pool
getmempoolentryReturns mempool data for a specific transaction that is currently in the memory pool
getmempoolancestorsReturns the in-mempool ancestors of a transaction: the unconfirmed transactions it depends on
getmempooldescendantsReturns the in-mempool descendants of a transaction: the unconfirmed transactions that depend on it
testmempoolacceptChecks whether one or more raw transactions would be accepted into the mempool, without broadcasting them

Raw Transactions Methods

MethodDescription
getrawtransactionReturns the raw transaction data for a given transaction id
sendrawtransactionSubmits a raw, fully signed transaction (serialized as hex) to the network
createrawtransactionCreates an unsigned raw transaction from a set of inputs and outputs and returns it as hex
decoderawtransactionDecodes a serialized, hex-encoded transaction into a json object
decodescriptDecodes a hex-encoded script and returns details about it, including its assembly, type, and the addresses it pays to
combinerawtransactionCombines multiple partially signed transactions of the same transaction into one fully signed transaction, returning the combined hex

PSBT Methods

MethodDescription
createpsbtCreates an empty partially signed bitcoin transaction (psbt) from a set of inputs and outputs, returning it as a base64 string
decodepsbtDecodes a base64-encoded psbt into a detailed json object, including the unsigned transaction, per-input data, and per-output data
analyzepsbtAnalyzes a psbt and reports what is missing for each input, the next role in the signing workflow, and the estimated fee and virtual size
combinepsbtCombines multiple psbts of the same transaction into one, merging the data each contains
finalizepsbtFinalizes a psbt once all inputs are signed and, if complete, extracts the network-ready transaction
converttopsbtConverts a raw transaction to a psbt
joinpsbtsJoins multiple distinct psbts into a single psbt by concatenating their inputs and outputs
utxoupdatepsbtUpdates a psbt with utxo information and, optionally, output descriptors, filling in the data needed for signing from the node's view of the chain

Mining Methods

MethodDescription
getmininginfoReturns mining-related information, including the current block height, difficulty, network hash rate, and mempool size
getnetworkhashpsEstimates the network hashes per second based on the last n blocks
getblocktemplateReturns data needed to construct a block to work on, following bip 22, bip 23, bip 9, and bip 145

Utility Methods

MethodDescription
estimatesmartfeeEstimates the approximate fee rate per kilobyte needed for a transaction to begin confirmation within a given number of blocks
validateaddressReturns information about a bitcoin address, including whether it is valid and its script type
deriveaddressesDerives one or more addresses from an output descriptor
verifymessageVerifies a signed message against a bitcoin address, returning whether the signature is valid for the address and message

Control Methods

MethodDescription
getrpcinfoReturns runtime details about the rpc server, including the commands currently in progress and the path to the active logging file
getmemoryinfoReturns information about memory usage, either as a human-readable summary or as raw malloc statistics depending on the mode
uptimeReturns the total number of seconds the node has been running
helpLists all available rpc commands, or returns detailed help for a specific command when one is supplied