api/v2/block - Litecoin

This endpoint returns block information with a paged list of the transactions it contains. The block can be selected by height or by hash.

Parameters

ParameterTypeLocationRequiredDescription
blockIdstringpathYesBlock height or block hash
pageintegerqueryNo1-based page index over the block's transactions

Request

bashcurl --location --request GET 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/block/0fc24234c2379a5262023a4b4a653ff3a11df6bb1c12851aff820d27ea02b0b6?page=1'

example.js

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

example.py

pythonimport requests

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

print(response.json())

Response

json{
    "page": 1,
    "totalPages": 1,
    "itemsOnPage": 1000,
    "hash": "0fc24234c2379a5262023a4b4a653ff3a11df6bb1c12851aff820d27ea02b0b6",
    "previousBlockHash": "e8a9b97499a1bf0bb21ebef8e30acf8fafb17145b7bd4269d5192e8039993941",
    "nextBlockHash": "eec4238a5bc1d4cbd2f2b3738bf34ca63a22c8db81ed4bf73a12360350ce8ada",
    "height": 3179800,
    "confirmations": 17,
    "size": 90534,
    "time": 1789699786,
    "version": 536870932,
    "merkleRoot": "4f5ddddee343643887ba017db6d76e7b5b834562a9198b60bc99cb84233bd22b",
    "nonce": "1815478550",
    "bits": "19309741",
    "difficulty": "88389131.60278592",
    "txCount": 60,
    "txs": [
        {
            "txid": "0df2b3ad2a6bae31bdf82108c01d7ae27dafe69cadb0188d542df9035982bbc0",
            "blockHeight": 3179800,
            "confirmations": 17,
            "blockTime": 1789699786,
            "value": "625073004",
            "valueIn": "0",
            "fees": "0"
        }
    ]
}

Response Parameters

FieldTypeDescription
hashstringBlock hash
previousBlockHashstringHash of the preceding block
nextBlockHashstringHash of the following block, when one exists
heightintegerBlock height
confirmationsintegerNumber of confirmations
sizeintegerBlock size in bytes
timeintegerBlock timestamp
merkleRootstringMerkle root of the block's transactions
difficultystringProof-of-work difficulty at this block
txCountintegerTotal number of transactions in the block
txsarrayTransactions on the requested page

Height lookups always resolve on the current main chain. A hash lookup can still return a block from another fork if the node retains it. Large blocks page at 1000 transactions, so check totalPages before assuming a single request covers the block.

Use Cases

  • Explorers: Render a block and its transactions
  • Chain Walking: Follow previousBlockHash and nextBlockHash to traverse the chain
  • Reconciliation: Scan a block's transactions for addresses of interest
  • Confirmation Context: Read a block's depth and timestamp

Error Handling

HTTP StatusMessageDescription
400Bad requestThe block id is not a valid height or hash
403ForbiddenMissing or invalid ACCESS-TOKEN
404Not foundNo block matches the requested id
500Internal errorThe indexer failed to read the block