Bitcoin Core

JSON-RPC API Reference

getbestblockhash

Returns the header hash of the most recent block on the best block chain.

JSON-RPC over HTTPS POST

curl \
--data '{"jsonrpc":"2.0","id":"1","method":"getbestblockhash","params":[]}' \
--header 'Content-Type: application/json' \
'https://bitcoincmain1575643079767.nodes.deploy.radar.tech/?apikey=YOUR_API_KEY'

Response

Returns - hex (string) the block hash hex encoded

{"result":"0000000000000000000102223b59a9c5168064e34b7c74bdfcde0f50a684264c","error":null,"id":"1"}

getblock

Gets a block with a particular header hash from the local block database either as a JSON object or as a serialized block.

  • If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.

  • If verbosity is 1, returns an Object with information about block .

  • If verbosity is 2, returns an Object with information about block and information about each transaction.

Parameters

  1. blockhash [required)

    • String representing the hash of a Block.

  2. verbosity [numeric, optional, default=1]

    • 0 for hex encoded data

    • 1 for a json object

    • 2 for json object with transaction data

JSON-RPC over HTTPS POST

curl \
--data '{"jsonrpc":"2.0","id":"1","method":"getblock","params":["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' \
--header 'Content-Type: application/json' \
'https://bitcoincmain1575643079767.nodes.deploy.radar.tech/?apikey=YOUR_API_KEY'

Response

Returns - data (string) A string that is serialized, hex-encoded data for block 'hash'.

{"result":{"hash":"00000000c937983704a73..."},"error":null,"id":"1"}

getblockcount

Returns the number of blocks in the local best block chain.

JSON-RPC over HTTPS POST

curl \
--data '{"jsonrpc":"2.0","id":"1","method":"getblockcount","params":[]}' \
--header 'Content-Type: application/json' \
'https://bitcoincmain1575643079767.nodes.deploy.radar.tech/?apikey=YOUR_API_KEY'

Response

Returns -n (numeric) The current block count

{"result":608744,"error":null,"id":"1"}

getblockhash

Returns the header hash of a block at the given height in the local best blockchain.

Parameters

  1. Height [required]

    • Numeric height index

JSON-RPC over HTTPS POST

curl \
--data '{"jsonrpc":"2.0","id":"1","method":"getblockhash","params":[]}' \
--header 'Content-Type: application/json' \
'https://bitcoincmain1575643079767.nodes.deploy.radar.tech/?apikey=YOUR_API_KEY'

Response

Returns - "hash" (string) The block hash

{"result":"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09","error":null,"id":"1"}

getblockheader

Gets a block header with a particular header hash from the local block database either as a JSON object or as a serialized block header.

Parameters

  1. hash [required]

    • The block hash

  2. verbose [optional, default=true]

    • True for a json object.

    • False for the hex encoded data.

JSON-RPC over HTTPS POST

curl \
--data '{"jsonrpc":"2.0","id":"1","method":"getblockheader","params":["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' \
--header 'Content-Type: application/json' \
'https://bitcoincmain1575643079767.nodes.deploy.radar.tech/?apikey=YOUR_API_KEY'

Response

Returns

Result (for verbose = true):

  • "hash" : "hash", (string) the block hash (same as provided)

  • "confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain

  • "height" : n, (numeric) The block height or index

  • "version" : n, (numeric) The block version

  • "versionHex" : "00000000", (string) The block version formatted in hexadecimal

  • "merkleroot" : (string) The merkle root

  • "time" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)

  • "mediantime" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)

  • "nonce" : n, (numeric) The nonce

  • "bits" : "1d00ffff", (string) The bits

  • "difficulty" : (numeric) The difficulty

  • "chainwork" : "0000...1f3" (string) Expected number of hashes required to produce the current chain (in hex)

  • "nTx" : n, (numeric) The number of transactions in the block.

  • "previousblockhash" : "hash", (string) The hash of the previous block

  • "nextblockhash" : "hash", (string) The hash of the next block

Result (for verbose=false):

  • "data" (string) A string that is serialized, hex-encoded data for block 'hash'.

{"result":{"hash":"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09","confirmations":613384,"height":1000,"version":1,"versionHex":"00000001","merkleroot":"fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33","time":1232346882,"mediantime":1232344831,"nonce":2595206198,"bits":"1d00ffff","difficulty":1,"chainwork":"000000000000000000000000000000000000000000000000000003e903e903e9","nTx":1,"previousblockhash":"0000000008e647742775a230787d66fdf92c46a48c896bfbc85cdc8acc67e87d","nextblockhash":"00000000a2887344f8db859e372e7e4bc26b23b9de340f725afbf2edb265b4c6"},"error":null,"id":"1"}

getdifficulty

Returns the proof-of-work difficulty as a multiple of the minimum difficulty.

JSON-RPC over HTTPS POST

curl \
--data '{"jsonrpc":"2.0","id":"1","method":"getdifficulty","params":[]}' \
--header 'Content-Type: application/json' \
'https://bitcoincmain1575643079767.nodes.deploy.radar.tech/?apikey=YOUR_API_KEY'

Response

Returns -n.nnn (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty.

{"result":12876842089682.48,"error":null,"id":"1"}

getrawmempool

Returns all transaction identifiers (TXIDs) in the memory pool as a JSON array, or detailed information about each transaction in the memory pool as a JSON object.

Parameters

  1. verbose [ optional, default=false]

    • True for a json object

    • False for array of transaction ids

JSON-RPC over HTTPS POST

curl \
--data '{"jsonrpc":"2.0","id":"1","method":"getrawmempool","params":[]}' \
--header 'Content-Type: application/json' \
'https://bitcoincmain1575643079767.nodes.deploy.radar.tech/?apikey=YOUR_API_KEY'

Response

Returns

Result (for verbose = false):

  • "transactionid" (string) The transaction id of an in-mempool ancestor transaction

Result (for verbose = true):

  • "transactionid" : { (json object)

  • "size" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.

  • "fee" : n, (numeric) transaction fee in BTC (DEPRECATED)

  • "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)

  • "time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT

  • "height" : n, (numeric) block height when transaction entered pool

  • "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one)

  • "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)

  • "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)

  • "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)

  • "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)

  • "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)

  • "wtxid" : hash, (string) hash of serialized transaction, including witness data

  • "fees" : {

  • "base" : n, (numeric) transaction fee in BTC

  • "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC

  • "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC

  • "descendant" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC

  • "depends" : (array) unconfirmed transactions used as inputs for this transaction

  • "transactionid", (string) parent transaction id

  • "spentby" : [ (array) unconfirmed transactions spending outputs from this transaction

  • "transactionid", (string) child transaction id

  • "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee)

{"result":["e6240a4182fc0f98ba0df3bde876a0fccbeec52352fe295660a5b04e02865270","cb0dece2ca2f6d583a7863a2f44e0044ac4486d5e1ca9d874bde91e3a171358a","a74f54e6c8975a3bacd4642865ca8e355ef89688c35fc5273bcecdffc6359b99","9777c2b79c3cc0298bc8018335880f24daad596e72cf6f64958eeaceb876ba40","6a2039565f146c40b2f97788ff3010896619343be866296105b52671b28a76d6","0264fd064577be125f4aff89123c33e32bf5ded0cf5e71a1c568483cf18d4fa7","1d2e66a2ef7eb808424f833ecd070a7af58e62b0634c2c9811b379e8b5a3ce94","3068438fbfd69e545cfca6f776098e9e7cae9f779a2ca45478973630fc2f7c16","12f8013a028b13d48b0d8c8fa5be5717be2cf...

Disabled Methods

Certain methods are disabled within DEPLOY Node clients for various reasons. Below is a list of methods that are not enabled on DEPLOY nodes by default. If you need access to any of the following methods on Bitcoin Core, please send us an email at support@deploy.radar.tech

List of disabled bitcoin core methods:

  • getblockchaininfo

  • getblockstats

  • getchaintips

  • getchaintxstats

  • getmempoolancestors

  • getmempooldescendants

  • getmempoolentry

  • getmempoolinfo

  • gettxout

  • gettxoutproof

  • gettxoutsetinfo

  • getmemoryinfo

  • getrpcinfo

  • preciousblock

  • pruneblockchain

  • savemempool

  • scantxoutset

  • verifychain

  • verifytxoutproof

  • logging

  • stop

  • uptime