The UTXO set by creation height: what remains unspent of each block's outputs after a block or a UTC day, and what a block or a day changed. Reconstructed from the UTXO set's history on demand. Supplies are in BTC; a set plus the next diff gives the next set, exact when each supply is rounded to 8 decimals. A date covers the day's published blocks, by each block's monotonic timestamp (the running maximum of block times), like URPD. The set excludes `OP_RETURN` outputs and the genesis coinbase (unspendable), and the coinbases of blocks 91812 and 91722 once duplicates at 91842 and 91880 overwrite them; it includes zero-value outputs.
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Bitview UTXO Set API
description: 'Bitview is a free, open-source Bitcoin data server: on-chain metrics, blocks, mempool and mining data, with charts and an API, at bitview.space or beside your own Bitcoin Core node.
API for querying Bitcoin blockchain data, mempool state, and on-chain series.
### Features
- **Mempool.space compatible**: Blocks, transactions, addresses, mining, fees, and mempool endpoints match the mempool.space REST API
- **Series**: Thousands of on-chain time-series across multiple indexes (date, block height, etc.)
- **Multiple formats**: JSON and CSV output
- **For LLMs**: `/llms.txt` for discovery, `/api.json` a compact custom summary of this spec for reading (not OpenAPI); build tools from `/openapi.json`
- **MCP**: Stateless, read-only access to these operations at mcp.bitview.space, with no authentication required
### Quick start
```bash
curl -s https://bitview.space/api/blocks/tip/height
curl -s https://bitview.space/api/v1/fees/recommended
curl -s https://bitview.space/api/mempool
curl -s https://bitview.space/api/series/search?q=price
```
### Errors
Errors use `application/problem+json`:
```json
{
"error": {
"type": "not_found",
"code": "series_not_found",
"message": "''foo'' not found, did you mean ''bar''? What became of it: /changes/?id=foo",
"doc_url": "/api"
}
}
```
- **`type`**: Error category, following the status — `invalid_request` (4xx other than 404), `not_found` (404), `unavailable` (503), `timeout` (504), or `internal` (other 5xx); see the `ErrorType` schema
- **`code`**: Machine-readable error code (e.g. `invalid_address`, `series_not_found`, `weight_exceeded`); see the `ErrorCode` schema
### Client Libraries
- JavaScript
- Python
- Rust
- MCP
### Links
- GitHub
- Bitview Studio - Charts of any series, built on this API'
termsOfService: https://bitview.space/terms/
contact:
name: Bitview
url: https://bitview.space/support/
email: support@bitview.space
license:
name: MIT
url: https://github.com/bitcoinresearchkit/mono/blob/main/LICENSE
version: v0.13.0
x-privacy-policy: https://bitview.space/privacy/
tags:
- name: UTXO Set
description: 'The UTXO set by creation height: what remains unspent of each block''s outputs after a block or a UTC day, and what a block or a day changed. Reconstructed from the UTXO set''s history on demand. Supplies are in BTC; a set plus the next diff gives the next set, exact when each supply is rounded to 8 decimals. A date covers the day''s published blocks, by each block''s monotonic timestamp (the running maximum of block times), like URPD.
The set excludes `OP_RETURN` outputs and the genesis coinbase (unspendable), and the coinbases of blocks 91812 and 91722 once duplicates at 91842 and 91880 overwrite them; it includes zero-value outputs.'
paths:
/api/utxo-set:
get:
tags:
- UTXO Set
summary: Latest UTXO set
description: The UTXO set after the latest published block, in the layout of `GET /api/utxo-set/{point}`.
operationId: get_utxo_set_latest
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/UtxoSet'
'304':
description: 'Not modified: the request''s validator matches the current representation'
'404':
description: Resource not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'400':
description: Invalid request parameters
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'500':
description: Internal server error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'503':
description: Service temporarily unavailable
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'504':
description: Request deadline exceeded
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
x-mcp-ignore: true
/api/utxo-set/{point}:
get:
tags:
- UTXO Set
summary: UTXO set at block height or date
description: The UTXO set after a block (`840000`) or after the last published block of a UTC day (`YYYY-MM-DD`), by creation height. Returns `{ height, hash, date, count, supply, origins }`; entry `i` of `origins.count` and `origins.supply` (BTC) is what remains unspent of block `i`'s outputs.
operationId: get_utxo_set
parameters:
- in: path
name: point
description: Confirmed block height (`840000`) or UTC calendar day (`YYYY-MM-DD`)
required: true
schema:
description: Confirmed block height (`840000`) or UTC calendar day (`YYYY-MM-DD`)
$ref: '#/components/schemas/HeightOrDate'
style: simple
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/UtxoSet'
'304':
description: 'Not modified: the request''s validator matches the current representation'
'404':
description: Resource not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'400':
description: Invalid request parameters
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'500':
description: Internal server error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'503':
description: Service temporarily unavailable
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'504':
description: Request deadline exceeded
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
x-mcp-ignore: true
/api/utxo-set/{point}/diff:
get:
tags:
- UTXO Set
summary: UTXO set changes of a block or date
description: 'What a block (`840000`) or a UTC day''s published blocks (`YYYY-MM-DD`) changed in the UTXO set. Returns `{ first, last, hash, date, created, spent }`: `created` has one row per block, `spent` one row per creation height, each as columnar `height`, `count` and `supply` (BTC). The set after block `first - 1` plus `created` minus `spent` is the set after block `last`.'
operationId: get_utxo_set_diff
parameters:
- in: path
name: point
description: Confirmed block height (`840000`) or UTC calendar day (`YYYY-MM-DD`)
required: true
schema:
description: Confirmed block height (`840000`) or UTC calendar day (`YYYY-MM-DD`)
$ref: '#/components/schemas/HeightOrDate'
style: simple
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/UtxoSetDiff'
'304':
description: 'Not modified: the request''s validator matches the current representation'
'404':
description: Resource not found
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'400':
description: Invalid request parameters
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'500':
description: Internal server error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'503':
description: Service temporarily unavailable
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'504':
description: Request deadline exceeded
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
components:
schemas:
ErrorDetail:
type: object
properties:
type:
description: Error category, following the HTTP status
allOf:
- $ref: '#/components/schemas/ErrorType'
code:
description: Machine-readable error code
allOf:
- $ref: '#/components/schemas/ErrorCode'
message:
description: Human-readable description
type: string
doc_url:
description: Link to API documentation
type: string
format: uri-reference
required:
- type
- code
- message
- doc_url
UtxoSetDiff:
description: What blocks `first` through `last` changed in the UTXO set.
type: object
properties:
first:
description: 'First block of the diff; it applies to the set after block `first - 1` (the empty set for
block 0).'
allOf:
- $ref: '#/components/schemas/Height'
last:
description: Last block of the diff, described by `hash` and `date`.
allOf:
- $ref: '#/components/schemas/Height'
hash:
description: Hash of block `last`.
allOf:
- $ref: '#/components/schemas/BlockHash'
date:
description: UTC date of block `last`'s monotonic timestamp.
allOf:
- $ref: '#/components/schemas/Date'
created:
description: 'Outputs created, one row per block, including those spent again within the range (which
`spent` lists too).'
allOf:
- $ref: '#/components/schemas/UtxoChanges'
spent:
description: 'Outputs removed, one row per creation height in ascending order: spent outputs, plus the
coinbase outputs of blocks 91812 and 91722, which duplicates at 91842 and 91880 overwrote.'
allOf:
- $ref: '#/components/schemas/UtxoChanges'
required:
- first
- last
- hash
- date
- created
- spent
Height:
description: 'A block height: how many blocks came before it.'
type: integer
format: uint32
minimum: 0
examples:
- 0
- 210000
- 420000
- 840000
Date:
description: Calendar date in YYYY-MM-DD format.
type: string
format: date
pattern: ^\d{4}-\d{2}-\d{2}$
examples:
- '2009-01-03'
- '2024-04-20'
BlockHash:
description: 'Double-SHA256 block-header hash, serialized in Bitcoin''s conventional
hexadecimal byte order.'
type: string
examples:
- 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
- 0000000000000000000320283a032748cef8227873ff4872689bf23f1cda83a5
pattern: ^[0-9a-f]{64}$
ErrorCode:
type: string
enum:
- not_found
- invalid_address
- invalid_network
- unsupported_type
- no_series
- series_unsupported_index
- weight_exceeded
- too_many_utxos
- limit_exceeded
- unknown_after_txid
- unknown_address
- unknown_txid
- unknown_pool
- out_of_range
- unindexable_date
- no_data
- series_not_found
- mempool_not_available
- state_updating
- internal_error
- bad_request
- overloaded
- timeout
- method_not_allowed
ErrorType:
description: 'Error category, following the HTTP status: `invalid_request` (4xx other than 404),
`not_found` (404), `unavailable` (503; `Retry-After` when transient), `timeout` (504), `internal`
(other 5xx).'
type: string
enum:
- invalid_request
- not_found
- unavailable
- timeout
- internal
UtxoChanges:
description: Columnar counts and supplies by creation height.
type: object
properties:
height:
description: Creation height of each row.
type: array
items:
$ref: '#/components/schemas/Height'
count:
description: Number of outputs in each row.
type: array
items:
type: integer
format: uint64
minimum: 0
supply:
description: BTC held by the outputs in each row.
type: array
items:
$ref: '#/components/schemas/Bitcoin'
required:
- height
- count
- supply
HeightOrDate:
description: 'A confirmed point of the chain: a block height (`840000`) or a UTC calendar day (`YYYY-MM-DD`).'
anyOf:
- $ref: '#/components/schemas/Height'
- $ref: '#/components/schemas/Date'
Bitcoin:
description: An amount in bitcoin, as a decimal number (1 BTC = 100,000,000 satoshis).
type: number
format: double
ErrorBody:
description: The JSON body of every API error (`application/problem+json`).
type: object
properties:
error:
$ref: '#/components/schemas/ErrorDetail'
required:
- error
UtxoOrigins:
description: Columnar unspent amounts indexed by creation height.
type: object
properties:
count:
description: Number of unspent outputs per creation height.
type: array
items:
type: integer
format: uint64
minimum: 0
supply:
description: BTC held by the unspent outputs per creation height.
type: array
items:
$ref: '#/components/schemas/Bitcoin'
required:
- count
- supply
UtxoSet:
description: 'The UTXO set after a block, grouped by the height of the block that created each output.
The set excludes `OP_RETURN` outputs and the genesis coinbase, which are unspendable, and the
coinbases of blocks 91812 and 91722 once duplicates at 91842 and 91880 overwrite them; it
includes zero-value outputs. The set after block `first - 1` plus a diff''s `created` minus its
`spent` gives the set after block `last`; rounding each supply to 8 decimals keeps it exact.'
type: object
properties:
height:
$ref: '#/components/schemas/Height'
hash:
$ref: '#/components/schemas/BlockHash'
date:
description: 'UTC date of the represented block''s monotonic timestamp (the running maximum of block
times).'
allOf:
- $ref: '#/components/schemas/Date'
count:
description: Number of unspent outputs.
type: integer
format: uint64
minimum: 0
supply:
description: BTC held by the unspent outputs.
allOf:
- $ref: '#/components/schemas/Bitcoin'
origins:
description: 'Unspent outputs by creation height: entry `i` is what remains of block `i`''s outputs.'
allOf:
- $ref: '#/components/schemas/UtxoOrigins'
required:
- height
- hash
- date
- count
- supply
- origins