Blockchain RPCs

getbestblockhash

Returns the hash of the best (tip) block in the most-work fully-validated chain.

Method: POST

https://btc.nownodes.io

Example body (raw)

{"jsonrpc": "1.0", "id": "curltest", "method": "getbestblockhash", "params": []}

Example response: 200

{
    "result": "0000000000000000000105be70f4867eacf87fd2f64acad34f0a85019aa2edbd",
    "error": null,
    "id": "curltest"
}

getblock

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 โ€˜hashโ€™.

If verbosity is 2, returns an Object with information about block โ€˜hashโ€™ and information about each transaction.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getblock",
    "params": [
        "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
    ]
}

Example response: 200

{
    "result": {
        "hash": "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09",
        "confirmations": 894190,
        "height": 1000,
        "version": 1,
        "versionHex": "00000001",
        "merkleroot": "fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33",
        "time": 1232346882,
        "mediantime": 1232344831,
        "nonce": 2595206198,
        "bits": "1d00ffff",
        "target": "000000000000000000025ced0000000000000000000000000000000000000000",
        "difficulty": 1,
        "chainwork": "000000000000000000000000000000000000000000000000000003e903e903e9",
        "nTx": 1,
        "previousblockhash": "0000000008e647742775a230787d66fdf92c46a48c896bfbc85cdc8acc67e87d",
        "nextblockhash": "00000000a2887344f8db859e372e7e4bc26b23b9de340f725afbf2edb265b4c6",
        "strippedsize": 216,
        "size": 216,
        "weight": 864,
        "tx": [
            "fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33"
        ]
    },
    "error": null,
    "id": "curltest"
}

getblockchaininfo

Returns an object containing various state info regarding blockchain processing.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getblockchaininfo",
    "params": []
}

Example response: 200

{
    "result": {
        "chain": "main",
        "blocks": 895189,
        "headers": 895189,
        "bestblockhash": "000000000000000000011b51bf16ff510179261d6d445a7951624cb703a653e6",
        "bits": "17025ced",
        "target": "000000000000000000025ced0000000000000000000000000000000000000000",
        "difficulty": 119116256505723.5,
        "time": 1746358307,
        "mediantime": 1746357020,
        "verificationprogress": 0.9999983842839637,
        "initialblockdownload": false,
        "chainwork": "0000000000000000000000000000000000000000c09d8ea7ef7a5551b7212c34",
        "size_on_disk": 746976756926,
        "pruned": false,
        "warnings": ""
    },
    "error": null,
    "id": "curltest"
}

getblockcount

Returns the height of the most-work fully-validated chain.

The genesis block has height 0.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getblockcount",
    "params": []
}

Example response: 200

{
    "result": 838324,
    "error": null,
    "id": "curltest"
}

getblockhash

Returns hash of block in best-block-chain at height provided.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getblockhash",
    "params": [
        1000
    ]
}

Example response: 200

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

getblockheader

If verbose is false, returns a string that is serialized, hex-encoded data for blockheader โ€˜hashโ€™.

If verbose is true, returns an Object with information about blockheader โ€˜hashโ€™.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getblockheader",
    "params": [
        "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
    ]
}

Example response: 200

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

getblockstats

Compute per block statistics for a given window. All amounts are in satoshis.

It wonโ€™t work for some heights with pruning.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getblockstats",
    "params": [
        1000,
        [
            "minfeerate",
            "avgfeerate"
        ]
    ]
}

Example response: 200

{
    "result": {
        "avgfeerate": 0,
        "minfeerate": 0
    },
    "error": null,
    "id": "curltest"
}

getchaintips

Return information about all known tips in the block tree, including the main chain as well as orphaned branches.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getchaintips",
    "params": []
}

Example response: 200

{
    "result": [
        {
            "height": 838408,
            "hash": "0000000000000000000290e2caf27f3f4d0799b1ce05b07d9ed492c187a2b3c4",
            "branchlen": 0,
            "status": "active"
        },
        {
            "height": 829613,
            "hash": "0000000000000000000357088139cba6dc295875d7d3b2dd1fd764705727e451",
            "branchlen": 1,
            "status": "valid-fork"
        },
        {
            "height": 827853,
            "hash": "00000000000000000002c7de4016a0d09a47c19075cb73947e7f66e3461efd27",
            "branchlen": 1,
            "status": "valid-fork"
        },
        {
            "height": 823226,
            "hash": "0000000000000000000365e705dbbea406f6e383f510d400fa23e40eae71e056",
            "branchlen": 1,
            "status": "valid-fork"
        },
        {
            "height": 822941,
            "hash": "00000000000000000003aaaacecbebd40417c2e6c39b5774a8a212d5b324052b",
            "branchlen": 1,
            "status": "valid-headers"
        },
        {
            "height": 819343,
            "hash": "0000000000000000000262af3fb1dd3bc62ad5a119c48a57267a3b96145ce82c",
            "branchlen": 1,
            "status": "valid-fork"
        },
        {
            "height": 818038,
            "hash": "000000000000000000029afbc6cbd660df5548a90ca9202e80866c5c680f29e4",
            "branchlen": 1,
            "status": "valid-fork"
        },
        {
            "height": 816358,
            "hash": "00000000000000000001d5f92e2dbbfcbc1e859873117e7983dd574857da5e14",
            "branchlen": 1,
            "status": "valid-headers"
        },
        {
            "height": 815570,
            "hash": "000000000000000000024c1b977ae540b29e329ccfc3bbb37f3b0880c2336212",
            "branchlen": 1,
            "status": "headers-only"
        },
        {
            "height": 815202,
            "hash": "0000000000000000000093917031004a140b6db5c6adec217f814db98d7f0bde",
            "branchlen": 1,
            "status": "valid-fork"
        },
        {
            "height": 813210,
            "hash": "000000000000000000021c9f203786c0adcd7ae9a68a25d5e430d2a3dba613d5",
            "branchlen": 1,
            "status": "valid-fork"
        },
        {
            "height": 811703,
            "hash": "0000000000000000000270d5eed2457bf394e45f5035c1d721f4f3ccecbb2ba5",
            "branchlen": 1,
            "status": "valid-headers"
        },
        {
            "height": 809478,
            "hash": "000000000000000000006840568a01091022093a176d12a1e8e5e261e4f11853",
            "branchlen": 1,
            "status": "invalid"
        },
        {
            "height": 807025,
            "hash": "000000000000000000048d93a8093bd9b104cadd46957a6d14ba3ce6f2a29b9f",
            "branchlen": 1,
            "status": "headers-only"
        },
        {
            "height": 804900,
            "hash": "00000000000000000004c20bfe0ed1a9b714fbc07710531b8252dc998f9ccd67",
            "branchlen": 1,
            "status": "valid-fork"
        },
        {
            "height": 803389,
            "hash": "00000000000000000002ea858e57fc91ec34ae26a1d2a53720d7d4e08334fba2",
            "branchlen": 1,
            "status": "valid-fork"
        },
        {
            "height": 800786,
            "hash": "000000000000000000020e419bbdd75f21609d5a050a24bafe45b73a1574127d",
            "branchlen": 1,
            "status": "valid-headers"
        },
        {
            "height": 797434,
            "hash": "00000000000000000000fe9e3172a5d9ee3b815d952476a31056bc007657b83f",
            "branchlen": 1,
            "status": "valid-headers"
        },
        {
            "height": 796038,
            "hash": "0000000000000000000552fdbbe1edbff2887ea7879dc777b33f8cefc4ba665e",
            "branchlen": 1,
            "status": "valid-headers"
        },
        {
            "height": 795426,
            "hash": "000000000000000000045d66a7991b54de7e11776eed27e34df24a59b7de370e",
            "branchlen": 1,
            "status": "headers-only"
        },
        {
            "height": 792379,
            "hash": "000000000000000000032956cbfd8721abe0572d81542e75e38e6185312bee09",
            "branchlen": 1,
            "status": "valid-fork"
        }
    ],
    "error": null,
    "id": "curltest"
}

getchaintxstats

Compute statistics about the total number and rate of transactions in the chain.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getchaintxstats",
    "params": [
        2016
    ]
}

Example response: 200

{
    "result": {
        "time": 1712641012,
        "txcount": 986076422,
        "window_final_block_hash": "0000000000000000000290e2caf27f3f4d0799b1ce05b07d9ed492c187a2b3c4",
        "window_final_block_height": 838408,
        "window_block_count": 2016,
        "window_tx_count": 5378370,
        "window_interval": 1168997,
        "txrate": 4.600841576154601
    },
    "error": null,
    "id": "curltest"
}    

getdifficulty

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

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getdifficulty",
    "params": []
}

Example response: 200

{
    "result": 83126997340024.61,
    "error": null,
    "id": "curltest"
}

getmempoolancestors

If txid is in the mempool, returns all in-mempool ancestors.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getmempoolancestors",
    "params": [
        "mytxid"
    ]
}

Example response: 200

{
    "result": null,
    "error": {
        "code": -8,
        "message": "parameter 1 must be of length 64 (not 6, for 'mytxid')"
    },
    "id": "curltest"
}

getmempooldescendants

If txid is in the mempool, returns all in-mempool descendants.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getmempooldescendants",
    "params": [
        "mytxid"
    ]
}

Example response: 200

{
    "result": null,
    "error": {
        "code": -8,
        "message": "parameter 1 must be of length 64 (not 6, for 'mytxid')"
    },
    "id": "curltest"
}

getmempoolentry

Returns mempool data for given transaction

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getmempoolentry",
    "params": [
        "mytxid"
    ]
}

Example response: 200

{
    "result": null,
    "error": {
        "code": -8,
        "message": "parameter 1 must be of length 64 (not 6, for 'mytxid')"
    },
    "id": "curltest"
}

getmempoolinfo

Returns details on the active state of the TX memory pool.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getmempoolinfo",
    "params": []
}

Example response: 200

{
    "result": {
        "loaded": true,
        "size": 64322,
        "bytes": 66649617,
        "usage": 306846352,
        "total_fee": 3.71106285,
        "maxmempool": 2000000000,
        "mempoolminfee": 0.00001000,
        "minrelaytxfee": 0.00001000,
        "incrementalrelayfee": 0.00001000,
        "unbroadcastcount": 0,
        "fullrbf": false
    },
    "error": null,
    "id": "curltest"
}

getrawmempool

Returns all transaction ids in memory pool as a json array of string transaction ids.

Hint: use getmempoolentry to fetch a specific transaction from the mempool.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "getrawmempool",
    "params": [
        true
    ]
}

Example response: 200

{
    "result": {
        "c588faa8996863f2a8942b6062e1e1aaa09cdfe35ad06cc8fae121cc6ede3602": {
            "vsize": 110,
            "weight": 437,
            "time": 1712644562,
            "height": 838416,
            "descendantcount": 1,
            "descendantsize": 110,
            "ancestorcount": 1,
            "ancestorsize": 110,
            "wtxid": "9d07a7bb953f1fe80d433fe01bdfacf2d65e0669057fa3b1e2a54c4a208d8815",
            "fees": {
                "base": 0.00025000,
                "modified": 0.00025000,
                "ancestor": 0.00025000,
                "descendant": 0.00025000
            },
            "depends": [],
            "spentby": [],
            "bip125-replaceable": true,
            "unbroadcast": false
        },
        "5c238df91299ec97983908fa972f91a0381e8a92f1a1092533377bf25e8c8171": {
            "vsize": 166,
            "weight": 662,
            "time": 1712644540,
            "height": 838415,
            "descendantcount": 1,
            "descendantsize": 166,
            "ancestorcount": 1,
            "ancestorsize": 166,
            "wtxid": "0c58d9a2f251c3e627ea39d7d6fcb638c810ab87f950d7da8c585aae858ea3ea",
            "fees": {
                "base": 0.00026316,
                "modified": 0.00026316,
                "ancestor": 0.00026316,
                "descendant": 0.00026316
            },
            "depends": [],
            "spentby": [],
            "bip125-replaceable": false,
            "unbroadcast": false
        },
        "ec2932b4f4672f12bc834c9c5c4ebd44e170699acae58c738e3df1636d1f7224": {
            "vsize": 142,
            "weight": 565,
            "time": 1712644562,
            "height": 838416,
            "descendantcount": 1,
            "descendantsize": 142,
            "ancestorcount": 1,
            "ancestorsize": 142,
            "wtxid": "b8b924434fec53f21211a9e0bbac216ad994c27ee2f7a4f3187a3e8e0257330f",
            "fees": {
                "base": 0.00017040,
                "modified": 0.00017040,
                "ancestor": 0.00017040,
                "descendant": 0.00017040
            },
            "depends": [],
            "spentby": [],
            "bip125-replaceable": true,
            "unbroadcast": false
        },
        "6d15a02f2c92418f25232d8977c9de73c776d9f1b7d565b7726ccd0a97e21d4b": {
            "vsize": 223,
            "weight": 892,
            "time": 1712644561,
            "height": 838416,
            "descendantcount": 1,
            "descendantsize": 223,
            "ancestorcount": 1,
            "ancestorsize": 223,
            "wtxid": "6d15a02f2c92418f25232d8977c9de73c776d9f1b7d565b7726ccd0a97e21d4b",
            "fees": {
                "base": 0.00025785,
                "modified": 0.00025785,
                "ancestor": 0.00025785,
                "descendant": 0.00025785
            },
            "depends": [],
            "spentby": [],
            "bip125-replaceable": true,
            "unbroadcast": false
        },
        "82aa5aa2fc593ad6699305f99e18145b9bfec58a740427fc6461512bc00be8ac": {
            "vsize": 225,
            "weight": 898,
            "time": 1712644523,
            "height": 838415,
            "descendantcount": 1,
            "descendantsize": 225,
            "ancestorcount": 1,
            "ancestorsize": 225,
            "wtxid": "e2aad847b915700c85120d21dcba8a08508a66e93e467d03c8cd162d2814d243",
            "fees": {
                "base": 0.00023175,
                "modified": 0.00023175,
                "ancestor": 0.00023175,
                "descendant": 0.00023175
            },
            "depends": [],
            "spentby": [],
            "bip125-replaceable": false,
            "unbroadcast": false
        },
...

gettxout

Returns details about an unspent transaction output.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "gettxout",
    "params": [
        "txid",
        1
    ]
}

Example response: 200

{
    "result": null,
    "error": {
        "code": -8,
        "message": "txid must be of length 64 (not 4, for 'txid')"
    },
    "id": "curltest"
}

gettxoutproof

Returns a hex-encoded proof that โ€œtxidโ€ was included in a block.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "gettxoutproof",
    "params": [
        [
            "ee652f0b40209bd02468de0c6336854f5efdd79fb865560aef2c46f4fa0b4a07",
            "cee11bc3bb3d9db8c4813ed2072a14369a15fcfb9e6bc5cb37a0b5bcc6aa59aa"
        ],
        null
    ]
}

Example response: 200

{
    "result": "000000202834abd71bdd0d3298542af4506918ea168ce002936b040000000000000000001da8757e4d756e848245cacf3e103c1b9f6ed2405c6d818a73172c8ec72856d4db3864606fdf0c17dcc1000ccb0300000cb86343fc64abcdab51e530303a4ee2b420fa6b5a12b435c9c76fe953ca5471ca074a0bfaf4462cef0a5665b89fd7fd5e4f8536630cde6824d09b20400b2f65eed9f744b2dc695b0ea0c4afd06310a21b93ddd7270a781acd0ada1afdd23b5750aa59aac6bcb5a037cbc56b9efbfc159a36142a07d23e81c4b89d3dbbc31be1cefe0bb7b0369ffc3b1d530e234987543a2613bbb8b06c86f993a930dee7b9d87f661ef556adc0174c7f180aa28006ee93ce2291302801ecd045c234c00b186ea35ff1e77eac3f113492e2eb12f38b9df452f5831f55c861865ac8f3c7dd06be2377f859ba1d12dea2ec44987796a27d42d5727250c1e0181d6a251f8272f21b9a2034069a2471de43de655619904d43b4665f6ce38741320998dc97838c32c79f1ada066ddf7a441357d55cc42a8906970bff2d5342be694002476733ff593af26f320c10df7ba9a76355438f462c040b598868dfb67c5e88d6d9a426ec8cdd74337d42df6b29e9fb319410848f3ff7228d00dc539e2962d185348ab9663a112a03ff6e00",
    "error": null,
    "id": "curltest"
}

preciousblock

Treats a block as if it were received before others with the same work.

A later preciousblock call can override the effect of an earlier one.

The effects of preciousblock are not retained across restarts.

Method: POST

https://btc.nownodes.io

Example body (raw)

{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "preciousblock",
    "params": [
        "blockhash"
    ]
}

Example response: 200

{
    "result": null,
    "error": {
        "code": -8,
        "message": "blockhash must be of length 64 (not 9, for 'blockhash')"
    },
    "id": "curltest"
}

Last updated