BitcoinDatabase.com

Query the chain · Crypto tax API

Crypto tax API for Bitcoin cost basis and historical price data

A crypto tax engine needs three things for every Bitcoin transaction: what moved and when, the fair market value in US dollars at the exact moment it happened, and enough history to reconstruct cost basis. Most price APIs give you only the middle piece, so you still stitch a separate chain source to it. This crypto tax API supplies all three from one fully-indexed source: every address, transaction and UTXO since the 2009 genesis block, with the historical price sitting in the same schema, so a single query returns a transaction and the FMV that applied when it confirmed.

That is what tax and accounting software actually consumes. Pull an address or xpub history over REST to seed a user's transaction list, then read the price at each block time to value acquisitions and disposals, or run SQL to band a wallet's coins into cost-basis cohorts across the whole holding period. You keep control of the accounting method and the final gain or loss; we deliver clean, reproducible, audit-friendly inputs. This is informational on-chain and market data, not tax, accounting, financial or legal advice.

or try it below ↓

REST API · SQL · dashboards · indexed from genesis

Query Console
btc
try:

Hit Run to query the fully-indexed Bitcoin blockchain.

BTC

30-day trend

informational on-chain data · not financial advice

REST API · SQL · dashboards, one indexed dataset. Querying the indexed Bitcoin blockchain ...
REST API SQL DASHBOARDS WEBHOOKS CSV EXPORT

Indexed from genesis queryable in seconds

On-chain data not financial advice

Why it works

What you get with crypto tax api

Price at the moment of each transaction

Capital gains math is only as good as the value you assign at the time of the trade. Because historical price lives in the same schema as the chain, you get the fair market value that applied at a transaction block time in the same query that returns the transaction, with no separate feed to reconcile.

Full history for real cost basis

Reconstruct a wallet from its first receive to today: every acquisition, disposal, fee and UTXO across the full holding period, so a tax engine can apply FIFO, LIFO or specific-identification against a complete and consistent record.

Reproducible and audit-friendly

The same query pinned to the same block height returns the same numbers every time, and you can export the underlying rows. That is what turns a tax figure into something an accountant or auditor can trace back to the chain.

What it handles

The indexed Bitcoin chain, queryable your way

Look up an address, a transaction, a UTXO, the rich list or an on-chain metric, by REST API, SQL or dashboard. The same authoritative data, reconciled block-by-block against the canonical chain, without running a node.

  • Pull an address or xpub transaction history for a tax report
  • Value each acquisition and disposal at its block-time price
  • Reconstruct cost basis across a full holding period
  • Band a wallet into cost-basis cohorts in SQL
  • Separate transfers between own wallets from taxable disposals
  • Export audit-ready rows behind every gain or loss
GET /v1/address/{addr} query result
200 · JSON
{
  "address": "bc1qxy2k…l0wdv8",
  "balance_btc": 68432.10,
  "balance_usd": 4612165420,
  "tx_count": 1284,
  "unspent_outputs": 37,
  "first_seen": "2014-02-09"
}
indexed from genesis · to the satoshi ✓ reconciled block-by-block

Why BitcoinDatabase

One platform, queryable three ways

Not a raw node to sync, not an indexer to build, and not five vendors to stitch together. The fully-indexed Bitcoin blockchain, available as a REST API, as SQL, and as dashboards, on one authoritative dataset.

REST API

Typed JSON for addresses, transactions, balances, UTXOs and metrics. Drop it into apps, wallets, explorers and agents with curl, Python or our SDKs.

SQL access

Run SQL directly against the indexed Bitcoin dataset for ad-hoc analysis, cohorts and exports, the same data the API and dashboards read from.

Compliance-first

Informational on-chain data and analytics only. Entity labels and flow tracing are framed as tooling to support a regulated team's own review, not accusations.

Good questions

Questions about crypto tax api

No. This is the data layer a crypto tax calculator runs on. It returns Bitcoin transaction history, the fair market value at each transaction time and cost-basis inputs; your software or accountant applies the accounting method and computes the final gain or loss. It is informational data, not tax advice.
Because historical price is indexed alongside the chain, every transaction can be joined to the market price that applied at the block time it confirmed, in one query. That gives a tax engine the fair market value in US dollars at the moment of acquisition or disposal without stitching a separate price feed to a separate blockchain source.

Explore more

More ways to query Bitcoin with BitcoinDatabase

Stop running a node. Just query Bitcoin.

Run your first query now and get on-chain data back by REST API, SQL or dashboard, indexed from the genesis block. Informational on-chain data only, not financial advice.

See pricing

Indexed from genesis · REST · SQL · dashboards · addresses, transactions, UTXOs, metrics