api/v2/block-index - Dash

This endpoint returns the block hash at a given block height. It converts a height into the hash used by hash-based block lookups.

Parameters

ParameterTypeLocationRequiredDescription
blockHeightintegerpathYesBlock height on the main chain

Request

bashcurl --location --request GET 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/block-index/2540600'
javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/block-index/2540600'
);
console.log(await response.json());
pythonimport requests

response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/block-index/2540600')

print(response.json())

Response

json{
    "blockHash": "00000000000000007409ab5be18f66b1f68795ff81d3b3b1d592574fae07c372"
}

Response Parameters

FieldTypeDescription
blockHashstringHash of the block at the requested height

Use Cases

  • Height to Hash: Resolve a height into a hash for a block lookup
  • Sequential Access: Walk the chain by height when indexing blocks
  • Checkpoint Checks: Confirm a height maps to an expected block hash
  • Explorer Links: Build block detail links from height inputs

Error Handling

HTTP StatusMessageDescription
400Bad requestThe block height or hash is malformed
404Not foundNo block matches the requested height or hash
500Internal errorThe indexer failed to read the block