For the complete documentation index, see llms.txt. This page is also available as Markdown.

block - Cardano

Example code for the block JSON_RPC method. Complete guide on how to use block JSON_RPC in GetBlock Web3 documentation.

This endpoint returns a block and its transactions, identified by index or hash. Balance-changing operations are expressed in the Rosetta operation model.

Parameters

The request body is a JSON object with the following fields.

Field
Type
Required
Description

network_identifier

object

Yes

The network to query

block_identifier

object

Yes

Partial identifier with an index or a hash

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/block' \
--header 'Content-Type: application/json' \
--data-raw '{
    "network_identifier": {
        "blockchain": "cardano",
        "network": "mainnet"
    },
    "block_identifier": {
        "index": 10453789
    }
}'
example.js
const response = await fetch(
    'https://go.getblock.io/<ACCESS-TOKEN>/block',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"network_identifier": {"blockchain": "cardano", "network": "mainnet"}, "block_identifier": {"index": 10453789}})
    }
);
console.log(await response.json());
example.py
import requests

response = requests.post(
    'https://go.getblock.io/<ACCESS-TOKEN>/block',
    headers={'Content-Type': 'application/json'},
    json={"network_identifier": {"blockchain": "cardano", "network": "mainnet"}, "block_identifier": {"index": 10453789}}
)

print(response.json())

Response

Response Parameters

Field
Type
Description

block.block_identifier

object

Index and hash of the block

block.parent_block_identifier

object

Index and hash of the parent block

block.timestamp

integer

Block timestamp in milliseconds

block.transactions

array

Transactions with their Rosetta operations

Use Cases

  • Block Explorers: Render block contents as Rosetta operations

  • Chain Indexing: Stream blocks into a Rosetta-based indexer

  • Reconciliation: Derive balance changes from block operations

  • Exchange Integration: Detect deposits by scanning block operations

Error Handling

Error Code
Message
Description

1

Invalid request

The request body is malformed or missing required fields

4

Block not found

The requested block does not exist on this node

5

Internal error

The node failed to answer the request

Was this helpful?