Cardano(ADA)

Cardano is a proof-of-stake Layer 1 blockchain that uses the Extended UTXO (EUTXO) accounting model and the Ouroboros consensus protocol. It supports native assets that move without smart contracts and Plutus scripts for programmable validation. GetBlock exposes Cardano through three interfaces: the Rosetta API, Ogmios over JSON-RPC, and Ogmios over WebSocket.

Key Features

  • EUTXO Model: Extends the unspent-output model with scripts and datums for deterministic validation.
  • Native Assets: Mints and transfers tokens as first-class ledger objects without contracts.
  • Ouroboros Consensus: Secures the chain with a peer-reviewed proof-of-stake protocol.
  • Staking and Delegation: Lets ada holders delegate to stake pools and earn rewards.
  • On-Chain Governance: Supports the Conway-era governance system of proposals and voting.
  • Plutus Scripts: Validates spending with scripts whose execution units are metered.
  • Rosetta Interface: Offers a standardized construction and data API for exchange integration.
  • Ogmios Bridge: Provides low-level ledger, network, and mempool access over JSON-RPC and WebSocket.

TECHNICAL DISCLAIMER.

GetBlock's Cardano API reference documentation is provided for informational purposes and developer experience. The canonical specifications are maintained by the Rosetta and Ogmios projects and by Input Output Global. The Rosetta interface follows the Rosetta API specification; the Ogmios interface follows the Ogmios v6 JSON-RPC API.

Network Information

PropertyValue
Network NameCardano Mainnet
Native CurrencyADA (1 ADA = 1,000,000 lovelace)
ConsensusOuroboros Proof of Stake
ModelExtended UTXO (EUTXO)
Address FormatBech32 (addr, stake)

Base URL

bashhttps://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/
bashwss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

Supported Networks

NetworkRosettaOgmios JSON-RPCOgmios WebSocket
Mainnet✅✅✅

APIs

Cardano is served through three interfaces. Each has its own reference section.

InterfaceTransportUse it for
RosettaHTTP POSTStandardized data and transaction construction, exchange flows
Ogmios JSON-RPCHTTP POSTLedger and network state queries, transaction submission
Ogmios WebSocketWebSocketChain synchronization, ledger-state acquisition, mempool monitoring

Quickstart

In this section, you will learn how to make your first call with either:

  • Javascript(Axios)
  • Python
  1. Setup project

    Create and initialize a new project:

    bashmkdir cardano-api-quickstart
    cd cardano-api-quickstart
    npm init --yes
  2. Install Axios

    bashnpm install axios
  3. Create file

    Create a new file named index.js. This is where you will make your first call.

  4. Set ES module type

    Set the ES module "type": "module" in your package.json.

  5. Add code

    Add the following code to index.js:

    index.js

    javascriptconst axios = require('axios');
    
    const url = 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/';
    
    const payload = {
      jsonrpc: '2.0',
      method: 'queryNetwork/blockHeight',
      id: 'getblock.io'
    };
    
    axios.post(url, payload, {
      headers: { 'Content-Type': 'application/json' }
    })
    .then(response => {
      const blockNumber = parseInt(response.data.result, 16);
      console.log('Current Block Number:', blockNumber);
    })
    .catch(error => console.error(error));

    Replace <ACCESS-TOKEN> with your actual access token from GetBlock.

  6. Run the script

    bashnode index.js

    Expected output (example):

    json{
        "jsonrpc": "2.0",
        "method": "queryNetwork/blockHeight",
        "result": 13748077,
        "id": "getblock.io"
    }
  1. Set up the project directory

    bashmkdir cardano-api-quickstart
    cd cardano-api-quickstart
  2. Create and activate a virtual environment

    bashpython -m venv venv
    source venv/bin/activate
    
    # On Windows, use venv\Scripts\activate
  3. Install requests

    bashpip install requests
  4. Create script

    Create a file called main.py with the following content:

    main.py

    pythonimport requests
    import json
    
    url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/"
    
    payload = json.dumps({
        "jsonrpc": "2.0",
        "method": "queryNetwork/blockHeight",
        "id": "getblock.io"
    })
    
    headers = {
        'Content-Type': 'application/json'
    }
    
    response = requests.post(url, headers=headers, data=payload)
    print(response.text)

    Replace <ACCESS-TOKEN> with your actual access token from GetBlock.

  5. Run the script

    bashpython main.py

Support

For technical support and questions:

See Also