Skip to main content

Bitcoin API Documentation

Bitquery indexes the full Bitcoin mainnet through a GraphQL API at https://graphql.bitquery.io. You get pre-parsed blocks, transactions, UTXO-level inputs and outputs, address balances, fee analytics, Omni Layer activity, and multi-hop fund-flow tracing — with historical USD values at transaction time for accounting and compliance workflows.

The guides below cover each API surface with ready-to-run GraphQL examples.

What you can do with the Bitcoin API​

  • Pull blocks by height, hash, or time window — difficulty, size, transaction counts, and timestamps.
  • Fetch transactions with input/output totals, per-transaction fees in BTC and USD, and pagination for large wallets.
  • Reconstruct address balances from raw UTXOs, including balance at a specific historical block height.
  • List individual UTXOs received and spent by an address inside any date range.
  • Aggregate fees paid by an address or across the network for fee-market analytics.
  • Track miner activity, block rewards, and first-active timestamps for mining pools.
  • Query Omni Layer transactions and transfers — USDT-on-Bitcoin and other Omni tokens.
  • Trace inbound and outbound fund flows across multiple hops with Coinpath.

Quick start​

Returns the five most recent Bitcoin blocks with height, difficulty, transaction count, and timestamp.

query {
bitcoin(network: bitcoin) {
blocks(options: {desc: "height", limit: 5}) {
height
difficulty
transactionCount
blockSizeBigInt
timestamp {
time(format: "%Y-%m-%d %H:%M:%S")
}
}
}
}

Run this in the GraphQL IDE and adapt filters for your use case.

API reference​

Core data​

Bitcoin Blocks API — Block lookups by height or hash, difficulty, block size, transaction counts, and time-window filters. Use for block explorers, mining dashboards, and network health monitoring.

Bitcoin Transactions API — Transaction-level data with input and output totals, fees in BTC and USD, version, locktime, and patterns for paginating through large address histories.

Bitcoin Inputs and Outputs API — UTXO-level detail: prevout references, script types, values, and historical BTC price context. Essential for balance reconstruction, wallet feeds, and proof-of-reserves workflows.

Addresses and balances​

Bitcoin Address API — Current and historical balances derived from UTXOs, addressStats aggregates, and first/last-active timestamps for any address or batch of addresses.

Fees​

Bitcoin Fee API — Per-transaction and aggregate fee queries in BTC and USD. Build fee-market charts, wallet spend analytics, or network-wide fee trend reports.

Omni Layer (USDT on Bitcoin)​

Bitcoin Omni Layer API — Omni transactions and per-address transfers for tokens like USDT-on-Bitcoin and other Omni-class assets riding on Bitcoin transactions.

Fund tracing​

Bitcoin Coinpath API — Multi-hop inbound and outbound fund-flow tracing between Bitcoin addresses. Used for compliance investigations, exchange deposit tracing, and treasury reconciliation.

Common use cases​

  • Exchange and custody reconciliation — Match deposits and withdrawals to UTXO-level movements across hot and cold wallets.
  • Compliance and AML — Follow Coinpath flows across hops with full block and transaction context for travel-rule and SAR workflows.
  • Institutional treasury — Automate proof-of-reserves, cold-wallet audits, and board-level BTC balance reporting.
  • Mining analytics — Track pool rewards, block production, and miner address activity over time.
  • Omni and colored-coin analytics — Monitor USDT-on-Bitcoin and other Omni assets alongside native BTC movements.

Bitcoin node vs Bitquery API​

bitcoind / Bitcoin RPCBitquery Bitcoin API
Raw chain state — you build the indexerPre-indexed: blocks, txs, UTXOs, addresses, Omni Layer
No historical analytics out of the boxHistory, joins, aggregations, USD conversion at trade time
Re-scan the chain to compute balancesOne query for current balance, balance at a height, or activity stats
Best for submitting transactions and full validationBest for analytics, dashboards, wallet UIs, compliance, and mining stats

For real-time, low-latency Bitcoin data, use Bitquery's Bitcoin Kafka stream (btc.transactions.proto). GraphQL subscriptions are not available for Bitcoin — Kafka is the real-time path.