dash

DASH

POST

GET

attention-sign-fillabandontransactionattention-sign-fillabortrescanattention-sign-filladdmultisigaddressattention-sign-filladdnodeattention-sign-fillbackupwalletattention-sign-fillbls_fromsecretattention-sign-fillbls_generateattention-sign-fillclearbannedattention-sign-fillcoinjoinattention-sign-fillcreatemultisigattention-sign-fillcreatewalletattention-sign-filldebugattention-sign-filldisconnectnodeattention-sign-filldumphdinfoattention-sign-filldumpprivkeyattention-sign-filldumpwalletattention-sign-fillencryptwalletattention-sign-fillfundrawtransactionattention-sign-fillgenerateattention-sign-fillgeneratetoaddressattention-sign-fillgetaddednodeinfoattention-sign-fillgetaddressbalanceattention-sign-fillgetaddressdeltasattention-sign-fillgetaddressesbylabelattention-sign-fillgetaddressinfoattention-sign-fillgetaddressmempoolattention-sign-fillgetaddresstxidsattention-sign-fillgetaddressutxosattention-sign-fillgetbalanceattention-sign-fillgetconnectioncountattention-sign-fillgetmemoryinfoattention-sign-fillgetnettotalsattention-sign-fillgetnetworkinfoattention-sign-fillgetnewaddressattention-sign-fillgetpeerinfoattention-sign-fillgetrawchangeaddressattention-sign-fillgetreceivedbyaddressattention-sign-fillgetreceivedbylabelattention-sign-fillgettransactionattention-sign-fillgetunconfirmedbalanceattention-sign-fillgetwalletinfoattention-sign-fillgobject_list-preparedattention-sign-fillgobject_prepareattention-sign-fillgobject_submitattention-sign-fillgobject_vote-aliasattention-sign-fillgobject_vote-confattention-sign-fillgobject_vote-manyattention-sign-fillgobjectattention-sign-fillimportaddressattention-sign-fillimportelectrumwalletattention-sign-fillimportmultiattention-sign-fillimportprivkeyattention-sign-fillimportprunedfundsattention-sign-fillimportpubkeyattention-sign-fillimportwalletattention-sign-fillkeepassattention-sign-fillkeypoolrefillattention-sign-filllistaddressbalancesattention-sign-filllistaddressgroupingsattention-sign-filllistbannedattention-sign-filllistlabelsattention-sign-filllistlockunspentattention-sign-filllistreceivedbyaddressattention-sign-filllistreceivedbylabelattention-sign-filllistsinceblockattention-sign-filllisttransactionsattention-sign-filllistunspentattention-sign-filllistwalletsattention-sign-fillloadwalletattention-sign-filllockunspentattention-sign-fillloggingattention-sign-fillmasternode_currentattention-sign-fillmasternode_outputsattention-sign-fillmasternode_winnerattention-sign-fillpingattention-sign-fillprioritisetransactionattention-sign-fillprotx_diffattention-sign-fillprotx_infoattention-sign-fillprotx_listattention-sign-fillprotx_register_fundattention-sign-fillprotx_register_prepareattention-sign-fillprotx_register_submitattention-sign-fillprotx_registerattention-sign-fillprotx_update_registrarattention-sign-fillprotx_update_serviceattention-sign-fillpruneblockchainattention-sign-fillquorum_dkgstatusattention-sign-fillquorum_getrecsigattention-sign-fillquorum_hasrecsigattention-sign-fillquorum_infoattention-sign-fillquorum_isconflictingattention-sign-fillquorum_listattention-sign-fillquorum_memberofattention-sign-fillquorum_selectquorumattention-sign-fillquorum_signattention-sign-fillquorum_verifyattention-sign-fillremoveprunedfundsattention-sign-fillrescanblockchainattention-sign-fillsavemempoolattention-sign-fillsendmanyattention-sign-fillsendtoaddressattention-sign-fillsetbanattention-sign-fillsetcoinjoinamountattention-sign-fillsetcoinjoinroundsattention-sign-fillsetlabelattention-sign-fillsetnetworkactiveattention-sign-fillsettxfeeattention-sign-fillsignmessageattention-sign-fillsignmessagewithprivkeyattention-sign-fillsignrawtransactionattention-sign-fillsignrawtransactionwithwalletattention-sign-fillstopattention-sign-fillsubmitblockattention-sign-fillunloadwalletattention-sign-fillupgradetohdattention-sign-fillverifychainlockattention-sign-fillverifyislockattention-sign-fillvoterawattention-sign-fillwalletlockattention-sign-fillwalletpassphraseattention-sign-fillwalletpassphrasechange
chevron-right

Last updated on January 1, 1970

4 min read

Method getblockheaders undefined ()
connect with JSON-RPC protocol

getblockheaders

info-circle-fill

Returns an array of items with information about the requested number ofblockheaders starting from the requested hash.

Parameters

header hash - string (hex)

The hash of the block header to get, encoded as hex in RPC byte order

count - number

Optional.

The number of block headers to get

verbose - boolean

Optional.

Set to false to get the block headers in serialized block format; set to true (the default) to get the decoded block headers as a JSON object

Request

curl --location --request POST 'https://dash.getblock.io/mainnet/' 
--header 'x-api-key: YOUR-API-KEY' 
--header 'Content-Type: application/json' 
--data-raw '{"jsonrpc": "2.0",
"method": "getblockheaders",
"params": ["00000000000000093711aeacfe1a827cb43c6d626230cdd2e41ad6f43c1e79d3", 2, true],
"id": "getblock.io"}'

Response

{
    "error": null,
    "id": "getblock.io",
    "result": [
        {
            "bits": "192ab4b3",
            "chainlock": true,
            "chainwork": "000000000000000000000000000000000000000000006150154939c35ffff276",
            "confirmations": 570,
            "difficulty": 100569386.2568106,
            "hash": "00000000000000093711aeacfe1a827cb43c6d626230cdd2e41ad6f43c1e79d3",
            "height": 1535345,
            "mediantime": 1631177973,
            "merkleroot": "f10d0de8fa4dc0f60cc6028a7f9caaff7927d9fe00114d8211e1527e557fdced",
            "nTx": 8,
            "nextblockhash": "0000000000000003233fbb738a1bf5e2876face7b801b020d276b9c6c3967c67",
            "nonce": 1119488789,
            "previousblockhash": "000000000000002c086772e3101b2e598d244e20b73211d1dd86c59584dc4407",
            "time": 1631178288,
            "version": 536870912,
            "versionHex": "20000000"
        },
        {
            "bits": "192b0d08",
            "chainlock": true,
            "chainwork": "0000000000000000000000000000000000000000000061501b3b843e4abfe01c",
            "confirmations": 569,
            "difficulty": 99763336.62605304,
            "hash": "0000000000000003233fbb738a1bf5e2876face7b801b020d276b9c6c3967c67",
            "height": 1535346,
            "mediantime": 1631178023,
            "merkleroot": "1040a7f9debde7aafb233eaf4af8d7358d4da5eb147d64ce1a146d293b945466",
            "nTx": 20,
            "nextblockhash": "0000000000000008dbf1daa69bafcc06d4886e0dcf4ab72cbb05574250ac4b9b",
            "nonce": 3915364214,
            "previousblockhash": "00000000000000093711aeacfe1a827cb43c6d626230cdd2e41ad6f43c1e79d3",
            "time": 1631178413,
            "version": 536870912,
            "versionHex": "20000000"
        }
    ]
}
banner icon

Start Building with GetBlock RPCs for Free