api/v2/block-index - Dogecoin

This endpoint returns the block hash at a given block height on the main chain.

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/6378930'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/block-index/6378930'
);
console.log(await response.json());

example.py

pythonimport requests

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

print(response.json())

Response

json{
    "blockHash": "afd10312739304ad5809a454bf723dd2f48fedc08600695fee147a23567be1cf"
}

Response Parameters

FieldTypeDescription
blockHashstringHash of the block at the requested height

Use Cases

  • Height to Hash: Resolve a height before fetching a block by hash
  • Chain Checks: Confirm which block occupies a height after a reorganization
  • Indexing: Walk heights sequentially while building a local index

Error Handling

HTTP StatusMessageDescription
400Bad requestA path or query parameter is malformed
403ForbiddenMissing or invalid ACCESS-TOKEN
404Not foundNo indexed data exists for the request
500Internal errorThe indexer failed to process the request