/rest/headers/{count}/{blockhash} - Dash

Returns up to <count> consecutive block headers starting from a given block hash, as a JSON array. Useful for syncing header chains.

Endpoint

httpGET /rest/headers/{count}/{blockhash}.json

Path Parameters

ParameterTypeDescription
countnumberNumber of headers to return
blockhashstringStarting block hash

Example

bashexport DASH_REST=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

curl "${DASH_REST}rest/headers/5/000000000000000abc12def34567890fedcba9876543210abcdef1234567890ff.json"

Response

json[
    {
        "hash": "000000000000000abc12def34567890fedcba9876543210abcdef1234567890ff",
        "height": 2100000,
        "time": 1730000000,
        "previousblockhash": "0x..."
    }
]

Response Fields

FieldTypeDescription
[]arrayConsecutive block headers from the starting hash

Use Cases

  • Header Sync: Walk the header chain in batches
  • Light Clients: Fetch headers without bodies
  • Verification: Validate the header chain

Error Handling

ErrorMessageDescription
404 / Not FoundNot foundThe starting hash is unknown
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect