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
| Property | Value |
|---|---|
| Network Name | Cardano Mainnet |
| Native Currency | ADA (1 ADA = 1,000,000 lovelace) |
| Consensus | Ouroboros Proof of Stake |
| Model | Extended UTXO (EUTXO) |
| Address Format | Bech32 (addr, stake) |
Base URL
bashhttps://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/bashwss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/Supported Networks
| Network | Rosetta | Ogmios JSON-RPC | Ogmios WebSocket |
|---|---|---|---|
| Mainnet | ✅ | ✅ | ✅ |
APIs
Cardano is served through three interfaces. Each has its own reference section.
| Interface | Transport | Use it for |
|---|---|---|
| Rosetta | HTTP POST | Standardized data and transaction construction, exchange flows |
| Ogmios JSON-RPC | HTTP POST | Ledger and network state queries, transaction submission |
| Ogmios WebSocket | WebSocket | Chain synchronization, ledger-state acquisition, mempool monitoring |
Quickstart
In this section, you will learn how to make your first call with either:
- Javascript(Axios)
- Python
Setup project
Create and initialize a new project:
bash
mkdir cardano-api-quickstart cd cardano-api-quickstart npm init --yesInstall Axios
bash
npm install axiosCreate file
Create a new file named
index.js. This is where you will make your first call.Set ES module type
Set the ES module
"type": "module"in yourpackage.json.Add code
Add the following code to
index.js:index.js
javascript
const 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.Run the script
bash
node index.jsExpected output (example):
json
{ "jsonrpc": "2.0", "method": "queryNetwork/blockHeight", "result": 13748077, "id": "getblock.io" }
Set up the project directory
bash
mkdir cardano-api-quickstart cd cardano-api-quickstartCreate and activate a virtual environment
bash
python -m venv venv source venv/bin/activate # On Windows, use venv\Scripts\activateInstall requests
bash
pip install requestsCreate script
Create a file called
main.pywith the following content:main.py
python
import 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.Run the script
bash
python main.py
Support
For technical support and questions:
- Support: support@getblock.io