Query Cardano Chain Data
Help the developer choose and use the right data provider for querying the Cardano blockchain.
When to use
- Developer needs to read UTxOs, transaction history, protocol parameters, or on-chain state
- Choosing between Blockfrost, Ogmios, Kupo, Koios, Cardano GraphQL, DB-Sync, or Oura
- Setting up a data pipeline from chain data
- Querying datum or script information attached to UTxOs
- Building a backend service that needs chain data
- Comparing hosted vs self-hosted infrastructure options
When NOT to use
- Building or submitting transactions (use transaction-building skills instead)
- Setting up a local devnet (use
setup-devnet skill)
- Writing smart contracts (use Aiken/Plutus skills)
- Wallet integration in a frontend (use
connect-wallet skill)
Key principles
- Match the provider to the use case. There is no single best provider. A dApp frontend has different needs than a data pipeline.
- Hosted APIs are faster to start; self-hosted gives control. Blockfrost and Koios are hosted. Ogmios, Kupo, DB-Sync require running infrastructure.
- Combine providers when needed. Ogmios + Kupo is a common pairing: Ogmios for tx submission and protocol params, Kupo for UTxO queries.
- Consider cost at scale. Hosted APIs have rate limits and pricing tiers. Self-hosted has infrastructure cost.
- Think about latency requirements. WebSocket (Ogmios) is lower latency than REST (Blockfrost). Local node queries are fastest.
Workflow
Step 1: Identify the context
Ask the developer (if not already clear):
- What are you building? (backend-service | dapp-frontend | data-pipeline | one-off-query)
- Do you need real-time chain-tip data or historical queries?
- Are you running your own Cardano node?
- What language/SDK are you using?
Step 2: Search Bundled Documentation
Search the bundled documentation for relevant content:
${CLAUDE_SKILL_DIR}/../../docs/sources/ogmios/ - Ogmios WebSocket bridge docs
${CLAUDE_SKILL_DIR}/../../docs/sources/blockfrost-openapi/ - Blockfrost API docs
${CLAUDE_SKILL_DIR}/../../docs/sources/koios/ - Koios API docs
${CLAUDE_SKILL_DIR}/../../docs/sources/cardano-graphql/ - Cardano GraphQL docs
${CLAUDE_SKILL_DIR}/../../docs/sources/db-sync/ - DB-Sync docs
${CLAUDE_SKILL_DIR}/../../docs/sources/yaci-store/ - Yaci Store (modular JVM indexer; see stores/, plugins/, usage/as-library/)
${CLAUDE_SKILL_DIR}/../../docs/sources/evolution-sdk/ - Evolution SDK docs (TypeScript client; see providers/ and querying/)
${CLAUDE_SKILL_DIR}/../../docs/sources/blockfrost-go/ - Blockfrost Go client (typed endpoint wrappers)
${CLAUDE_SKILL_DIR}/../../docs/sources/utxorpc-go-sdk/ - UTxORPC Go SDK (provider-agnostic gRPC)
${CLAUDE_SKILL_DIR}/../../docs/sources/gouroboros/ - gOuroboros (direct node mini-protocols)
${CLAUDE_SKILL_DIR}/../../docs/sources/dingo/ - Dingo (Go node serving UTxORPC / Blockfrost-compatible / Mesh)
${CLAUDE_SKILL_DIR}/../../docs/sources/adder/ - Adder (Go event pipeline; docs/swagger.yaml for its REST surface)
Step 3: Evaluate providers for the context
Search the reference file for detailed provider comparisons.
File: skills/query-chain/references/provider-comparison.md
Quick decision guide
| Context |
Recommended Primary |
Alternative |
| backend-service |
Ogmios + Kupo (self-hosted) or Blockfrost (hosted) |
Koios (hosted, free tier) |
| dapp-frontend |
Blockfrost (via SDK) or Koios |
Ogmios via backend proxy |
| data-pipeline |
Oura or Adder (streaming) or DB-Sync (SQL) |
Cardano GraphQL |
| one-off-query |
Koios (free, no signup) or Blockfrost |
cardano-cli with local node |
Step 4: Describe each viable option
For each provider that fits the developer's context, explain:
- How to set it up -- installation, configuration, API keys
- How to make the query -- specific API calls, endpoints, or queries
- Code example -- using their SDK/language of choice
- Limitations -- rate limits, missing data, latency
Step 5: Provider-specific guidance
Blockfrost (Hosted REST API)
- Sign up at blockfrost.io for a project ID
- REST API with comprehensive endpoints
- SDKs: JavaScript, Python, Rust, Go, Java, Kotlin, Swift, Elixir
- Rate limits: free tier 50k requests/day, 10 req/s sustained, 500 req burst capacity
- Great for: quick prototyping, frontend dApps, moderate traffic backends
GET /addresses/{address}/utxos
GET /txs/{hash}
GET /epochs/latest/parameters
Ogmios (Self-hosted WebSocket)
- Requires a running cardano-node
- WebSocket JSON-RPC protocol (low latency)
- Local state queries: UTxOs, protocol parameters, chain tip
- Transaction submission and evaluation
- Best for: backends co-located with a node, tx submission workflows
Kupo (Self-hosted HTTP indexer)
- Indexes UTxOs by address, asset, or datum hash
- Lightweight, fast, pattern-based matching
- REST API on top of indexed data
- Often paired with Ogmios for a complete solution
- Best for: UTxO lookups, datum resolution, asset queries
Koios (Hosted REST API, community-run)
- Free tier with generous limits
- No API key required for basic use
- Comprehensive endpoints similar to Blockfrost
- Community-maintained, decentralized backend nodes
- Best for: open-source projects, quick queries, no-signup needs
Dingo (Self-hosted node with APIs built in)
A Cardano node implementation in Go that serves the query layer itself, so one
process replaces the usual node-plus-Ogmios-plus-Kupo stack:
- UTxO RPC (default port
9090), a Blockfrost-compatible REST API (3000), and
Mesh / Coinbase Rosetta (8080), each enabled and bound through
DINGO_PLUGINS_API_*_CONFIG_PORT
- Because the REST API is Blockfrost-compatible, existing Blockfrost client code
and the mirrored Blockfrost OpenAPI spec both apply — point the client at your
own host instead of the hosted service
- Storage mode is the gotcha. The client-facing APIs require
storageMode: "api" (full indexing). The lighter "core" mode carries only
what consensus needs and will not serve them.
- Its own README states Dingo is pre-production: testnets and devnets only, not
mainnet with real funds. Treat it as a development and testnet query layer,
and keep Blockfrost, Koios, or Ogmios + Kupo for anything mainnet-facing.
Cardano GraphQL (Self-hosted GraphQL)
- GraphQL interface over cardano-db-sync
- Flexible queries with relationships
- Requires DB-Sync + PostgreSQL + Hasura
- Best for: complex relational queries, custom data views
DB-Sync (Self-hosted PostgreSQL)
- Full blockchain data in PostgreSQL
- Direct SQL access to all chain data
- Heavy resource requirements (100GB+ disk, significant RAM)
- Best for: analytics, complex historical queries, data warehousing
Oura (Self-hosted pipeline)
- Event-driven pipeline from cardano-node
- Outputs to Kafka, Elasticsearch, webhooks, files
- Filters and maps chain events
- Best for: real-time event processing, data pipelines, notifications
Adder (Self-hosted pipeline, Go)
- Same shape as Oura in a Go process: an input stage follows the chain, filters
narrow the stream, output stages emit it
- Inputs are chainsync (over NtC or NtN), mempool, and UTxORPC, so it can follow
a node directly or ride on a UTxORPC provider; the chainsync input emits
input.block, input.rollback, input.transaction, and input.governance,
each with its own payload
- Outputs include webhook, push, notify, log, and Telegram
- Filters narrow by event type, address, asset fingerprint, minting policy, pool
ID, or DRep ID (
WithTypes, WithAddresses, WithAssetFingerprints,
WithPolicies, WithPoolIds, WithDRepIds)
- Runs standalone or embeds as a library, which is the reason to pick it over
Oura: a Go service can consume the event stream in-process instead of
shipping it through a broker first
- Best for: Go backends reacting to chain events, webhook fan-out, alerting
Evolution SDK (TypeScript client over providers)
Not a provider — a TypeScript library that wraps Blockfrost, Kupmios, Maestro, and Koios behind one query interface, so the provider becomes a config choice rather than a code rewrite. For read-only work, build a provider-only client (no wallet attached):
import { Address, Client, preprod } from "@evolution-sdk/evolution"
const client = Client.make(preprod).withBlockfrost({
baseUrl: "https://cardano-preprod.blockfrost.io/api/v0",
projectId: process.env.BLOCKFROST_PROJECT_ID!,
}) // or .withKupmios(...) / .withMaestro(...) / .withKoios(...) — same query API
const utxos = await client.getUtxos(Address.fromBech32("addr_test1..."))
const nftUtxo = await client.getUtxoByUnit(unit) // the one UTxO holding an NFT
const datum = await client.getDatum(datumHash)
const params = await client.getProtocolParameters()
const { poolId, rewards } = await client.getDelegation(rewardAddress)
Query methods: getUtxos, getUtxosWithUnit, getUtxoByUnit, getUtxosByOutRef, getDatum, getDelegation, getProtocolParameters, awaitTx. Best for: TypeScript backends and dApps that want one query API independent of the underlying provider. See ${CLAUDE_SKILL_DIR}/../../docs/sources/evolution-sdk/providers/ and .../querying/.
Go clients over providers
Three Go paths, ordered by how much infrastructure you run:
- blockfrost-go — typed client for the hosted Blockfrost REST API.
NewAPIClient(APIClientOptions{...}), then methods mirroring the REST surface (Transaction, TransactionUTXOs, TransactionMetadata, and the Address* / Epoch* / Pool* families). Inherits every Blockfrost trade-off above, including rate limits. Also covers IPFS and webhook signature verification.
- UTxORPC Go SDK — the role Evolution SDK plays for TypeScript: the provider becomes a config choice rather than a code rewrite, against any UTxORPC-compatible backend. Paging query helpers (
GetUtxosByAddressPages, GetUtxosByAssetPages, tuned with WithSearchMaxItems / WithSearchStartToken); submit and mempool operations on UtxorpcClient (SubmitTx, EvalTx, WaitForTx, ReadMempool, WatchMempool). Best when you may switch providers later.
- gOuroboros — speaks the node's mini-protocols directly, with no intermediary.
NewConnection(...), then LocalStateQuery().Client for point-in-time state (GetUTxOByAddress, GetUTxOByTxIn, GetCurrentProtocolParams, GetStakeDistribution, GetDRepState, GetProposals) or ChainSync().Client to follow the chain (GetCurrentTip, GetAvailableBlockRange, Sync). Lowest latency and no third party, but you run the node and manage the protocol lifecycle yourself.
Runnable examples ship in the mirror: ${CLAUDE_SKILL_DIR}/../../docs/sources/gouroboros/examples/state-query/main.go and .../examples/chain-sync/main.go. Because Go sources mirror .go files, Grep a method name to get its signature and doc comment.
Step 6: Provide working code
Give the developer a working code snippet for their chosen provider and language. Always include:
- Dependency installation
- Client initialization
- The specific query they need
- Error handling
- Response parsing
Step 7: Address common issues
- Stale data: Hosted APIs may lag behind chain tip by a few seconds
- Datum resolution: Not all providers return inline datums; may need separate lookup
- Pagination: Large result sets require pagination (Blockfrost pages, Kupo cursors)
- Network selection: Ensure provider is configured for the right network (mainnet/preprod/preview)
- CORS: Frontend apps need CORS-friendly endpoints or a backend proxy
References
1---2name: query-chain3description: Guides finding the best way to query Cardano blockchain data. Triggers: "query chain", "read UTxOs", "fetch blockchain data", "Blockfrost vs Ogmios", "chain indexer", "query Cardano", "get transaction data", "read on-chain state", "query chain from Go".4---56<!-- Documentation lookup path: ${CLAUDE_SKILL_DIR}/../../docs/sources/ -->78# Query Cardano Chain Data910Help the developer choose and use the right data provider for querying the Cardano blockchain.1112## When to use1314- Developer needs to read UTxOs, transaction history, protocol parameters, or on-chain state15- Choosing between Blockfrost, Ogmios, Kupo, Koios, Cardano GraphQL, DB-Sync, or Oura16- Setting up a data pipeline from chain data17- Querying datum or script information attached to UTxOs18- Building a backend service that needs chain data19- Comparing hosted vs self-hosted infrastructure options2021## When NOT to use2223- Building or submitting transactions (use transaction-building skills instead)24- Setting up a local devnet (use `setup-devnet` skill)25- Writing smart contracts (use Aiken/Plutus skills)26- Wallet integration in a frontend (use `connect-wallet` skill)2728## Key principles29301. **Match the provider to the use case.** There is no single best provider. A dApp frontend has different needs than a data pipeline.312. **Hosted APIs are faster to start; self-hosted gives control.** Blockfrost and Koios are hosted. Ogmios, Kupo, DB-Sync require running infrastructure.323. **Combine providers when needed.** Ogmios + Kupo is a common pairing: Ogmios for tx submission and protocol params, Kupo for UTxO queries.334. **Consider cost at scale.** Hosted APIs have rate limits and pricing tiers. Self-hosted has infrastructure cost.345. **Think about latency requirements.** WebSocket (Ogmios) is lower latency than REST (Blockfrost). Local node queries are fastest.3536## Workflow3738### Step 1: Identify the context3940Ask the developer (if not already clear):4142- **What are you building?** (backend-service | dapp-frontend | data-pipeline | one-off-query)43- **Do you need real-time chain-tip data or historical queries?**44- **Are you running your own Cardano node?**45- **What language/SDK are you using?**4647### Step 2: Search Bundled Documentation4849Search the bundled documentation for relevant content:50- `${CLAUDE_SKILL_DIR}/../../docs/sources/ogmios/` - Ogmios WebSocket bridge docs51- `${CLAUDE_SKILL_DIR}/../../docs/sources/blockfrost-openapi/` - Blockfrost API docs52- `${CLAUDE_SKILL_DIR}/../../docs/sources/koios/` - Koios API docs53- `${CLAUDE_SKILL_DIR}/../../docs/sources/cardano-graphql/` - Cardano GraphQL docs54- `${CLAUDE_SKILL_DIR}/../../docs/sources/db-sync/` - DB-Sync docs55- `${CLAUDE_SKILL_DIR}/../../docs/sources/yaci-store/` - Yaci Store (modular JVM indexer; see `stores/`, `plugins/`, `usage/as-library/`)56- `${CLAUDE_SKILL_DIR}/../../docs/sources/evolution-sdk/` - Evolution SDK docs (TypeScript client; see `providers/` and `querying/`)57- `${CLAUDE_SKILL_DIR}/../../docs/sources/blockfrost-go/` - Blockfrost Go client (typed endpoint wrappers)58- `${CLAUDE_SKILL_DIR}/../../docs/sources/utxorpc-go-sdk/` - UTxORPC Go SDK (provider-agnostic gRPC)59- `${CLAUDE_SKILL_DIR}/../../docs/sources/gouroboros/` - gOuroboros (direct node mini-protocols)60- `${CLAUDE_SKILL_DIR}/../../docs/sources/dingo/` - Dingo (Go node serving UTxORPC / Blockfrost-compatible / Mesh)61- `${CLAUDE_SKILL_DIR}/../../docs/sources/adder/` - Adder (Go event pipeline; `docs/swagger.yaml` for its REST surface)6263### Step 3: Evaluate providers for the context6465Search the reference file for detailed provider comparisons.6667```68File: skills/query-chain/references/provider-comparison.md69```7071#### Quick decision guide7273| Context | Recommended Primary | Alternative |74|---|---|---|75| **backend-service** | Ogmios + Kupo (self-hosted) or Blockfrost (hosted) | Koios (hosted, free tier) |76| **dapp-frontend** | Blockfrost (via SDK) or Koios | Ogmios via backend proxy |77| **data-pipeline** | Oura or Adder (streaming) or DB-Sync (SQL) | Cardano GraphQL |78| **one-off-query** | Koios (free, no signup) or Blockfrost | cardano-cli with local node |7980### Step 4: Describe each viable option8182For each provider that fits the developer's context, explain:83841. **How to set it up** -- installation, configuration, API keys852. **How to make the query** -- specific API calls, endpoints, or queries863. **Code example** -- using their SDK/language of choice874. **Limitations** -- rate limits, missing data, latency8889### Step 5: Provider-specific guidance9091#### Blockfrost (Hosted REST API)9293- Sign up at blockfrost.io for a project ID94- REST API with comprehensive endpoints95- SDKs: JavaScript, Python, Rust, Go, Java, Kotlin, Swift, Elixir96- Rate limits: free tier 50k requests/day, 10 req/s sustained, 500 req burst capacity97- Great for: quick prototyping, frontend dApps, moderate traffic backends9899```100GET /addresses/{address}/utxos101GET /txs/{hash}102GET /epochs/latest/parameters103```104105#### Ogmios (Self-hosted WebSocket)106107- Requires a running cardano-node108- WebSocket JSON-RPC protocol (low latency)109- Local state queries: UTxOs, protocol parameters, chain tip110- Transaction submission and evaluation111- Best for: backends co-located with a node, tx submission workflows112113#### Kupo (Self-hosted HTTP indexer)114115- Indexes UTxOs by address, asset, or datum hash116- Lightweight, fast, pattern-based matching117- REST API on top of indexed data118- Often paired with Ogmios for a complete solution119- Best for: UTxO lookups, datum resolution, asset queries120121#### Koios (Hosted REST API, community-run)122123- Free tier with generous limits124- No API key required for basic use125- Comprehensive endpoints similar to Blockfrost126- Community-maintained, decentralized backend nodes127- Best for: open-source projects, quick queries, no-signup needs128129#### Dingo (Self-hosted node with APIs built in)130131A Cardano node implementation in Go that serves the query layer itself, so one132process replaces the usual node-plus-Ogmios-plus-Kupo stack:133134- UTxO RPC (default port `9090`), a Blockfrost-compatible REST API (`3000`), and135 Mesh / Coinbase Rosetta (`8080`), each enabled and bound through136 `DINGO_PLUGINS_API_*_CONFIG_PORT`137- Because the REST API is Blockfrost-compatible, existing Blockfrost client code138 and the mirrored Blockfrost OpenAPI spec both apply — point the client at your139 own host instead of the hosted service140- **Storage mode is the gotcha.** The client-facing APIs require141 `storageMode: "api"` (full indexing). The lighter `"core"` mode carries only142 what consensus needs and will not serve them.143- Its own README states Dingo is pre-production: testnets and devnets only, not144 mainnet with real funds. Treat it as a development and testnet query layer,145 and keep Blockfrost, Koios, or Ogmios + Kupo for anything mainnet-facing.146147#### Cardano GraphQL (Self-hosted GraphQL)148149- GraphQL interface over cardano-db-sync150- Flexible queries with relationships151- Requires DB-Sync + PostgreSQL + Hasura152- Best for: complex relational queries, custom data views153154#### DB-Sync (Self-hosted PostgreSQL)155156- Full blockchain data in PostgreSQL157- Direct SQL access to all chain data158- Heavy resource requirements (100GB+ disk, significant RAM)159- Best for: analytics, complex historical queries, data warehousing160161#### Oura (Self-hosted pipeline)162163- Event-driven pipeline from cardano-node164- Outputs to Kafka, Elasticsearch, webhooks, files165- Filters and maps chain events166- Best for: real-time event processing, data pipelines, notifications167168#### Adder (Self-hosted pipeline, Go)169170- Same shape as Oura in a Go process: an input stage follows the chain, filters171 narrow the stream, output stages emit it172- Inputs are chainsync (over NtC or NtN), mempool, and UTxORPC, so it can follow173 a node directly or ride on a UTxORPC provider; the chainsync input emits174 `input.block`, `input.rollback`, `input.transaction`, and `input.governance`,175 each with its own payload176- Outputs include webhook, push, notify, log, and Telegram177- Filters narrow by event type, address, asset fingerprint, minting policy, pool178 ID, or DRep ID (`WithTypes`, `WithAddresses`, `WithAssetFingerprints`,179 `WithPolicies`, `WithPoolIds`, `WithDRepIds`)180- Runs standalone or embeds as a library, which is the reason to pick it over181 Oura: a Go service can consume the event stream in-process instead of182 shipping it through a broker first183- Best for: Go backends reacting to chain events, webhook fan-out, alerting184185#### Evolution SDK (TypeScript client over providers)186187Not a provider — a TypeScript library that wraps Blockfrost, Kupmios, Maestro, and Koios behind one query interface, so the provider becomes a config choice rather than a code rewrite. For read-only work, build a **provider-only client** (no wallet attached):188189```typescript190import { Address, Client, preprod } from "@evolution-sdk/evolution"191192const client = Client.make(preprod).withBlockfrost({193 baseUrl: "https://cardano-preprod.blockfrost.io/api/v0",194 projectId: process.env.BLOCKFROST_PROJECT_ID!,195}) // or .withKupmios(...) / .withMaestro(...) / .withKoios(...) — same query API196197const utxos = await client.getUtxos(Address.fromBech32("addr_test1..."))198const nftUtxo = await client.getUtxoByUnit(unit) // the one UTxO holding an NFT199const datum = await client.getDatum(datumHash)200const params = await client.getProtocolParameters()201const { poolId, rewards } = await client.getDelegation(rewardAddress)202```203204Query methods: `getUtxos`, `getUtxosWithUnit`, `getUtxoByUnit`, `getUtxosByOutRef`, `getDatum`, `getDelegation`, `getProtocolParameters`, `awaitTx`. Best for: TypeScript backends and dApps that want one query API independent of the underlying provider. See `${CLAUDE_SKILL_DIR}/../../docs/sources/evolution-sdk/providers/` and `.../querying/`.205206#### Go clients over providers207208Three Go paths, ordered by how much infrastructure you run:209210- **blockfrost-go** — typed client for the hosted Blockfrost REST API. `NewAPIClient(APIClientOptions{...})`, then methods mirroring the REST surface (`Transaction`, `TransactionUTXOs`, `TransactionMetadata`, and the `Address*` / `Epoch*` / `Pool*` families). Inherits every Blockfrost trade-off above, including rate limits. Also covers IPFS and webhook signature verification.211- **UTxORPC Go SDK** — the role Evolution SDK plays for TypeScript: the provider becomes a config choice rather than a code rewrite, against any UTxORPC-compatible backend. Paging query helpers (`GetUtxosByAddressPages`, `GetUtxosByAssetPages`, tuned with `WithSearchMaxItems` / `WithSearchStartToken`); submit and mempool operations on `UtxorpcClient` (`SubmitTx`, `EvalTx`, `WaitForTx`, `ReadMempool`, `WatchMempool`). Best when you may switch providers later.212- **gOuroboros** — speaks the node's mini-protocols directly, with no intermediary. `NewConnection(...)`, then `LocalStateQuery().Client` for point-in-time state (`GetUTxOByAddress`, `GetUTxOByTxIn`, `GetCurrentProtocolParams`, `GetStakeDistribution`, `GetDRepState`, `GetProposals`) or `ChainSync().Client` to follow the chain (`GetCurrentTip`, `GetAvailableBlockRange`, `Sync`). Lowest latency and no third party, but you run the node and manage the protocol lifecycle yourself.213214Runnable examples ship in the mirror: `${CLAUDE_SKILL_DIR}/../../docs/sources/gouroboros/examples/state-query/main.go` and `.../examples/chain-sync/main.go`. Because Go sources mirror `.go` files, `Grep` a method name to get its signature and doc comment.215216### Step 6: Provide working code217218Give the developer a working code snippet for their chosen provider and language. Always include:219220- Dependency installation221- Client initialization222- The specific query they need223- Error handling224- Response parsing225226### Step 7: Address common issues227228- **Stale data**: Hosted APIs may lag behind chain tip by a few seconds229- **Datum resolution**: Not all providers return inline datums; may need separate lookup230- **Pagination**: Large result sets require pagination (Blockfrost pages, Kupo cursors)231- **Network selection**: Ensure provider is configured for the right network (mainnet/preprod/preview)232- **CORS**: Frontend apps need CORS-friendly endpoints or a backend proxy233234## References235236- `skills/query-chain/references/provider-comparison.md` -- Detailed comparison of the providers with decision matrix237- Blockfrost docs: https://docs.blockfrost.io238- Ogmios docs: https://ogmios.dev239- Kupo docs: https://cardanosolutions.github.io/kupo240- Koios docs: https://api.koios.rest241- DB-Sync docs: https://github.com/IntersectMBO/cardano-db-sync242- Oura docs: https://github.com/txpipe/oura243- UTxORPC: https://utxorpc.org244- blockfrost-go: https://pkg.go.dev/github.com/blockfrost/blockfrost-go