- bitview_client
- BitviewError
- SeriesData
- DateSeriesData
- SeriesEndpoint
- DateSeriesEndpoint
- BitviewClient
- VERSION
- INDEXES
- POOL_SLUG_TO_NAME
- TERM_NAMES
- HALVING_EPOCH_NAMES
- VINTAGE_NAMES
- ENTRY_NAMES
- SPENDABLE_TYPE_NAMES
- AGE_RANGE_NAMES
- AMOUNT_RANGE_NAMES
- PROFITABILITY_RANGE_NAMES
- OP_RETURN_KIND_NAMES
- __init__
- series
- series_endpoint
- index_to_date
- date_to_index
- address_payload_hash_prefix
- get_address_payload_hash_prefix_matches
- get_health
- get_version
- get_sync_status
- get_logs
- get_disk_usage
- get_series_tree
- get_series_count
- list_indexes
- list_series
- search_series
- get_series_info
- get_series
- get_series_data
- get_series_latest
- get_series_len
- get_series_version
- get_series_bulk
- list_urpd_cohorts
- get_urpd_latest
- get_urpd
- get_difficulty_adjustment
- get_prices
- get_historical_price
- get_address_hash_prefix_matches
- get_address
- get_address_txs
- get_address_confirmed_txs
- get_address_confirmed_txs_after
- get_address_mempool_txs
- get_address_utxos
- validate_address
- get_block
- get_block_v1
- get_block_header
- get_block_hash_by_height
- get_block_by_timestamp
- get_block_raw
- get_block_status
- get_block_tip_height
- get_block_tip_hash
- get_block_txid
- get_block_txids
- get_block_txs
- get_block_txs_from_index
- get_blocks
- get_blocks_from_height
- get_blocks_v1
- get_blocks_v1_from_height
- get_pools
- get_pool_ranking
- get_pool
- get_pools_hashrate
- get_pools_hashrate_by_period
- get_pool_hashrate
- get_pool_blocks
- get_pool_blocks_from_height
- get_hashrate
- get_hashrate_by_period
- get_difficulty_adjustments
- get_difficulty_adjustments_by_period
- get_reward_stats
- get_block_fees
- get_block_rewards
- get_block_fee_rates
- get_block_fee_rates_precise
- get_block_sizes_weights
- get_mempool_blocks
- get_recommended_fees
- get_precise_fees
- get_mempool
- get_mempool_txids
- get_mempool_recent
- get_replacements
- get_fullrbf_replacements
- get_mempool_block
- get_mempool_block_diff
- get_txid_by_index
- get_cpfp
- get_tx_rbf
- get_tx
- get_tx_hex
- get_tx_merkleblock_proof
- get_tx_merkle_proof
- get_tx_outspend
- get_tx_outspends
- get_tx_raw
- get_tx_status
- get_transaction_times
- post_tx
- get_utxo_set_latest
- get_utxo_set
- get_utxo_set_diff
- get_live_price
- get_oracle_live
- get_oracle_block
- get_oracle_payments
- get_openapi
- get_api
class BitviewError(Exception)A failed request: the HTTP status and the server's error code and message, when it sent them.
@dataclass
class SeriesData(Generic[T])Always int-indexed; a value is None where it is missing or undefined.
@dataclass
class DateSeriesData(SeriesData[T])class SeriesEndpoint(Generic[T])Builder for series endpoint queries with int-based indexing.
Examples: data = endpoint.fetch() data = endpoint[5].fetch() data = endpoint[:10].fetch() data = endpoint.head(20).fetch() data = endpoint.skip(100).take(10).fetch()
class DateSeriesEndpoint(SeriesEndpoint[T])Builder for series endpoint queries with date-based indexing.
Accepts dates in getitem and returns DateSeriesData from fetch().
Examples: data = endpoint[date(2020, 1, 1)].fetch() data = endpoint[date(2020, 1, 1):date(2023, 1, 1)].fetch()
class BitviewClient(BitviewClientBase)A method per API endpoint, and the typed series tree.
def __init__(base_url: str = 'http://localhost:3110', timeout: float = 30.0)@cached_property
def series() -> SeriesTreedef series_endpoint(
series: str,
index: Index) -> Union[SeriesEndpoint[Any], DateSeriesEndpoint[Any]]A series by a name known only at runtime; series has the typed paths.
def index_to_date(index: Index, i: int) -> Union[date, datetime]The start of bucket i: a UTC datetime for sub-daily indexes, a date otherwise.
def date_to_index(index: Index, d: Union[date, datetime]) -> intThe floor index (latest index whose date is <= the given date).
@staticmethod
def address_payload_hash_prefix(payload: Union[bytes, bytearray, memoryview],
nibbles: int) -> strCompute the RapidHash v3 hash-prefix for raw address payload bytes.
def get_address_payload_hash_prefix_matches(
address_type: AddressOutputType, payload: Union[bytes, bytearray,
memoryview],
nibbles: int) -> AddressHashPrefixMatchesFetch address hash-prefix matches from raw payload bytes matching address_type length.
def get_health() -> HealthHealth check.
Local health and query-readiness check. Returns server identity, uptime, and a coherent local sync snapshot without a bitcoind round-trip. Reads the published prefix during processing; an empty index returns 503 state_updating at once. Responses are not cached. For chain-tip catch-up, request GET /api/server/sync.
Endpoint: GET /health
def get_version() -> ServerVersionAPI version
Endpoint: GET /version
def get_sync_status() -> SyncStatusSync status.
Returns a coherent local index snapshot and a separately observed Bitcoin Core tip height. The two heights can differ during indexing or a reorg. Conditional requests refresh these observations before validation.
Endpoint: GET /api/server/sync
def get_logs(after: Optional[str] = None) -> LogsLogs.
The server's last log lines, at most 1,000, oldest first: requests (status, path and duration; never who made them) and everything else it logs. To read on, send the answer's next back as after: the lines since, each once. A jump in seq shows lines that left memory before the next request; another started_unix_ms shows the server restarted (and its answer has every kept line). Answers are cached for a second.
Endpoint: GET /api/server/logs
def get_disk_usage() -> DiskUsageDisk usage.
Returns allocated file bytes (file lengths on non-Unix platforms) for BRK and Bitcoin data. Each request scans both trees; these are independent observations, not an atomic filesystem snapshot. Conditional requests validate the newly observed totals. Directory-link cycles and excessive nesting fail without returning partial totals.
Endpoint: GET /api/server/disk
def get_series_tree() -> TreeNodeSeries catalog.
The available series as a tree of categories and subcategories.
Endpoint: GET /api/series
def get_series_count() -> DetailedSeriesCountSeries count.
Returns the number of series available per index type.
Endpoint: GET /api/series/count
def list_indexes() -> List[Index]List available indexes.
Returns every index a series can be read at, by the name series routes take.
Endpoint: GET /api/series/indexes
def list_series(page: Optional[int] = None,
per_page: Optional[int] = None) -> PaginatedSeriesSeries list.
Paginated flat list of all available series names.
Endpoint: GET /api/series/list
def search_series(q: str, limit: Optional[int] = None) -> List[SeriesName]Search series.
Search series by name or descriptive terms. Results prioritize whole query words in names, then descriptions, then fuzzy names, then fuzzy descriptions. Word order does not matter. Descriptions provide cohort terminology and formulas. The decoded q parameter is limited to 1024 UTF-8 bytes.
Endpoint: GET /api/series/search
def get_series_info(series: SeriesName) -> SeriesInfoGet series info.
Returns the optional description, supported indexes, the indexes whose values can be null, the value type, and the optional unit (what the value type measures) for the specified series. The decoded series name is limited to 1024 UTF-8 bytes.
Endpoint: GET /api/series/{series}
def get_series(series: SeriesName,
index: Index,
start: Optional[RangeIndex] = None,
end: Optional[RangeIndex] = None,
limit: Optional[Limit] = None,
format: Optional[Format] = None) -> Union[AnySeriesData, str]Get series data.
Rows selected by a range of positions, dates or timestamps, as JSON or CSV.
Endpoint: GET /api/series/{series}/{index}
def get_series_data(series: SeriesName,
index: Index,
start: Optional[RangeIndex] = None,
end: Optional[RangeIndex] = None,
limit: Optional[Limit] = None,
format: Optional[Format] = None) -> Union[List[Any], str]Get raw series data.
The data array without the SeriesData wrapper. Supports the same range and format parameters as GET /api/series/{series}/{index}.
Endpoint: GET /api/series/{series}/{index}/data
def get_series_latest(series: SeriesName, index: Index) -> AnyGet latest series value.
Returns the single most recent value for a series, unwrapped (not inside a SeriesData object).
Endpoint: GET /api/series/{series}/{index}/latest
def get_series_len(series: SeriesName, index: Index) -> intGet series data length
Endpoint: GET /api/series/{series}/{index}/len
def get_series_version(series: SeriesName, index: Index) -> VersionGet series version.
Returns the vector's schema/computation version, not its length or latest update. Appends and reorgs do not by themselves change this version.
Endpoint: GET /api/series/{series}/{index}/version
def get_series_bulk(
series: SeriesList,
index: Index,
start: Optional[RangeIndex] = None,
end: Optional[RangeIndex] = None,
limit: Optional[Limit] = None,
format: Optional[Format] = None) -> Union[List[AnySeriesData], str]Bulk series data.
Fetch multiple series in a single request. Supports filtering by index and date range. Returns an array of SeriesData objects. For a single series, use get_series instead.
Endpoint: GET /api/series/bulk
def list_urpd_cohorts() -> List[UrpdCohort]Available URPD cohorts.
Every URPD cohort once a UTXO set is published (none before): the age aggregates (all, sth, lth, age_under_4m, ...), then the age bands from the youngest (age_under_1h, age_1h_to_1d, ...).
Endpoint: GET /api/urpd
def get_urpd_latest(cohort: UrpdCohort,
agg: Optional[UrpdAggregation] = None,
weight: Optional[UrpdWeight] = None) -> UrpdLatest URPD.
URPD for the latest published block; date echoes the date served. Fields, units, price-grid rounding and weighting as in GET /api/urpd/{cohort}/{point}.
Endpoint: GET /api/urpd/{cohort}
def get_urpd(cohort: UrpdCohort,
point: HeightOrDate,
agg: Optional[UrpdAggregation] = None,
weight: Optional[UrpdWeight] = None) -> UrpdURPD at block height or date.
URPD for a cohort at a block height or the last block of a UTC day. Returns { height, hash, date, cohort, weight, aggregation, close, supply, buckets } where buckets is columns, { price, supply, realized_cap, unrealized_pnl }, one entry per bucket in ascending price: the same block header and columnar layout as GET /api/utxo-set/{point}. close, price, realized_cap, and unrealized_pnl are USD; supply is BTC. unrealized_pnl can be negative. Bucket realized_cap and unrealized_pnl value each coin at its creation price on the price grid (four significant digits of the price in cents, within 0.05% of the exact price), rounded to the cent per bucket, so the buckets need not sum to the realized cap series. With a wakefulness or mobility weight, supply is the weighted supply (whole satoshis) and the bucket values follow it.
Endpoint: GET /api/urpd/{cohort}/{point}
def get_difficulty_adjustment() -> DifficultyAdjustmentDifficulty adjustment.
Get current difficulty adjustment progress and estimates.
Endpoint: GET /api/v1/difficulty-adjustment
def get_prices() -> PricePointCurrent BTC price.
Returns bitcoin latest price (on-chain derived, USD only).
Endpoint: GET /api/v1/prices
def get_historical_price(
timestamp: Optional[Timestamp] = None,
currency: Optional[Currency] = None) -> HistoricalPriceHistorical price.
Completed four-hour BTC/USD closes, newest first as mempool.space lists them, labeled by interval end, from the first priced interval (2010-08-16). With a UNIX timestamp, returns the latest nonempty completed close at or before it; before the first close returns an empty list. The current partial interval is excluded. USD only (currency accepts USD); exchangeRates is empty.
Endpoint: GET /api/v1/historical-price
def get_address_hash_prefix_matches(address_type: AddressOutputType,
prefix: str) -> AddressHashPrefixMatchesAddress hash-prefix matches.
Find addresses by address type and by the first 1-16 hex nibbles of RapidHash v3 over the raw address payload bytes. Intended for privacy-preserving client-side wallet discovery without sending raw addresses or xpubs. Fetch metadata with GET /api/address/{address}.
Endpoint: GET /api/address/hash-prefix/{address_type}/{prefix}
def get_address(address: Address) -> AddressStatsAddress information.
Balance and transaction counts. Supports P2PKH, P2SH, P2WPKH, P2WSH, P2TR and P2A addresses, and P2PK public keys in hex (33 or 65 bytes).
Endpoint: GET /api/address/{address}
def get_address_txs(address: Address,
after_txid: Optional[Txid] = None,
max_txs: Optional[int] = None) -> List[Transaction]Address transactions.
Get transaction history for an address, newest first: up to max_txs (50 by default and at most), mempool transactions first and confirmed ones filling the rest. To continue, pass the last returned txid as after_txid, or request GET /api/address/{address}/txs/chain/{after_txid} for confirmed history.
Endpoint: GET /api/address/{address}/txs
def get_address_confirmed_txs(address: Address,
max_txs: Optional[int] = None
) -> List[Transaction]Address confirmed transactions.
Get the newest confirmed transactions for an address, up to max_txs (25 by default and at most). For pagination, request GET /api/address/{address}/txs/chain/{after_txid} with the last returned txid.
Endpoint: GET /api/address/{address}/txs/chain
def get_address_confirmed_txs_after(
address: Address,
after_txid: Txid,
max_txs: Optional[int] = None) -> List[Transaction]Address confirmed transactions (paginated).
Get the next confirmed transactions strictly older than after_txid, up to max_txs (25 by default and at most); a txid outside the address's history answers [] (Esplora-canonical pagination form, matches mempool.space).
Endpoint: GET /api/address/{address}/txs/chain/{after_txid}
def get_address_mempool_txs(address: Address,
max_txs: Optional[int] = None
) -> List[Transaction]Address mempool transactions.
Get unconfirmed transactions for an address from the mempool, newest first, up to max_txs (50 by default and at most).
Endpoint: GET /api/address/{address}/txs/mempool
def get_address_utxos(address: Address) -> List[Utxo]Address UTXOs.
Get unspent transaction outputs (UTXOs) for an address, including unconfirmed ones; outputs that mempool transactions spend are left out.
Endpoint: GET /api/address/{address}/utxo
def validate_address(address: str) -> AddressValidationValidate address.
Validate a Bitcoin address and get information about its type and scriptPubKey. Returns isvalid: false with an error message for invalid addresses; a string that isn't 2 to 130 letters and digits answers 400.
Endpoint: GET /api/v1/validate-address/{address}
def get_block(hash: BlockHash) -> BlockInfoBlock information.
Endpoint: GET /api/block/{hash}
def get_block_v1(hash: BlockHash) -> BlockInfoV1Block (v1).
Returns block details with extras by hash.
Endpoint: GET /api/v1/block/{hash}
def get_block_header(hash: BlockHash) -> HexBlock header.
Returns the hex-encoded 80-byte block header.
Endpoint: GET /api/block/{hash}/header
def get_block_hash_by_height(height: Height) -> BlockHashBlock hash by height.
Block hash as plain text.
Endpoint: GET /api/block-height/{height}
def get_block_by_timestamp(timestamp: Timestamp) -> BlockTimestampBlock by timestamp.
Find the block with the greatest header timestamp at or before the given UNIX timestamp, choosing the earliest height on ties.
Endpoint: GET /api/v1/mining/blocks/timestamp/{timestamp}
def get_block_raw(hash: BlockHash) -> bytesRaw block.
Returns the raw block data in binary format.
Endpoint: GET /api/block/{hash}/raw
def get_block_status(hash: BlockHash) -> BlockStatusBlock status.
Whether the block is in the best chain and, if so, its height and the hash of the next block. A block outside the best chain (orphaned or unknown) reports in_best_chain: false.
Endpoint: GET /api/block/{hash}/status
def get_block_tip_height() -> HeightBlock tip height.
Endpoint: GET /api/blocks/tip/height
def get_block_tip_hash() -> BlockHashBlock tip hash.
Endpoint: GET /api/blocks/tip/hash
def get_block_txid(hash: BlockHash, index: BlockTxIndex) -> TxidTransaction ID at index.
Retrieve a single transaction ID at a specific index within a block. Returns plain text txid.
Endpoint: GET /api/block/{hash}/txid/{index}
def get_block_txids(hash: BlockHash) -> List[Txid]Block transaction IDs.
Transaction IDs in block order.
Endpoint: GET /api/block/{hash}/txids
def get_block_txs(hash: BlockHash) -> List[Transaction]Block transactions.
Up to 25 transactions starting at index 0.
Endpoint: GET /api/block/{hash}/txs
def get_block_txs_from_index(hash: BlockHash,
start_index: BlockTxIndex) -> List[Transaction]Block transactions (paginated).
Up to 25 transactions starting at start_index, a multiple of 25.
Endpoint: GET /api/block/{hash}/txs/{start_index}
def get_blocks() -> List[BlockInfo]Recent blocks.
The last 10 blocks.
Endpoint: GET /api/blocks
def get_blocks_from_height(height: Height) -> List[BlockInfo]Blocks from height.
Retrieve up to 10 blocks going backwards from the given height. For example, height=100 returns blocks 100, 99, 98, ..., 91. Height=0 returns only block 0. A height past the tip is not found.
Endpoint: GET /api/blocks/{height}
def get_blocks_v1() -> List[BlockInfoV1]Recent blocks with extras.
Retrieve the last 15 blocks with extended data including pool identification and fee statistics.
Endpoint: GET /api/v1/blocks
def get_blocks_v1_from_height(height: Height) -> List[BlockInfoV1]Blocks from height with extras.
Retrieve up to 15 blocks with extended data going backwards from the given height: the published blocks among the 15 heights ending at it, so fewer (or none) past the tip.
Endpoint: GET /api/v1/blocks/{height}
def get_pools() -> List[PoolInfo]List all mining pools.
Endpoint: GET /api/v1/mining/pools
def get_pool_ranking(time_period: TimePeriod) -> PoolsSummaryMining pool statistics.
Get mining pool statistics for a time period.
Endpoint: GET /api/v1/mining/pools/{time_period}
def get_pool(slug: PoolSlug) -> PoolDetailMining pool details.
Block counts and mining shares by time period for one pool.
Endpoint: GET /api/v1/mining/pool/{slug}
def get_pools_hashrate() -> List[PoolHashrateEntry]All pools hashrate (all time).
Get weekly hashrate data, over the whole chain, of the mining pools that mined in the last week, by time and then their weekly rank.
Endpoint: GET /api/v1/mining/hashrate/pools
def get_pools_hashrate_by_period(
time_period: TimePeriod) -> List[PoolHashrateEntry]All pools hashrate.
Get weekly hashrate data, for a time period, of the mining pools that mined in the last week, by time and then their weekly rank.
Endpoint: GET /api/v1/mining/hashrate/pools/{time_period}
def get_pool_hashrate(slug: PoolSlug) -> List[PoolHashrateEntry]Mining pool hashrate.
Get hashrate history for a specific mining pool.
Endpoint: GET /api/v1/mining/pool/{slug}/hashrate
def get_pool_blocks(slug: PoolSlug) -> List[BlockInfoV1]Mining pool blocks.
Get up to 100 recent blocks mined by a specific pool.
Endpoint: GET /api/v1/mining/pool/{slug}/blocks
def get_pool_blocks_from_height(slug: PoolSlug,
height: Height) -> List[BlockInfoV1]Mining pool blocks before height.
Get up to 100 blocks mined by a specific pool strictly below the given height (pass the last height of a page to get the next one).
Endpoint: GET /api/v1/mining/pool/{slug}/blocks/{height}
def get_hashrate() -> HashrateSummaryNetwork hashrate (all time).
Get network hashrate and difficulty data for all time.
Endpoint: GET /api/v1/mining/hashrate
def get_hashrate_by_period(time_period: TimePeriod) -> HashrateSummaryNetwork hashrate.
Get network hashrate and difficulty data for a time period.
Endpoint: GET /api/v1/mining/hashrate/{time_period}
def get_difficulty_adjustments() -> List[DifficultyAdjustmentEntry]Difficulty adjustments (all time).
Endpoint: GET /api/v1/mining/difficulty-adjustments
def get_difficulty_adjustments_by_period(
time_period: TimePeriod) -> List[DifficultyAdjustmentEntry]Difficulty adjustments.
Get historical difficulty adjustments for a time period.
Endpoint: GET /api/v1/mining/difficulty-adjustments/{time_period}
def get_reward_stats(block_count: int) -> RewardStatsMining reward statistics.
Get mining reward statistics for the last N blocks including total rewards, fees, and transaction count.
Endpoint: GET /api/v1/mining/reward-stats/{block_count}
def get_block_fees(time_period: TimePeriod) -> List[BlockFeesEntry]Block fees.
Get average total fees per block for a time period.
Endpoint: GET /api/v1/mining/blocks/fees/{time_period}
def get_block_rewards(time_period: TimePeriod) -> List[BlockRewardsEntry]Block rewards.
Get average coinbase reward (subsidy + fees) per block for a time period.
Endpoint: GET /api/v1/mining/blocks/rewards/{time_period}
def get_block_fee_rates(time_period: TimePeriod) -> List[BlockFeeRatesEntry]Block fee rates.
Get block fee rate percentiles (min, 10th, 25th, median, 75th, 90th, max) for a time period, each a whole sat/vB (/precise for 3 decimals).
Endpoint: GET /api/v1/mining/blocks/fee-rates/{time_period}
def get_block_fee_rates_precise(
time_period: TimePeriod) -> List[BlockFeeRatesPreciseEntry]Block fee rates (precise).
Get block fee rate percentiles (min, 10th, 25th, median, 75th, 90th, max) for a time period, each in sat/vB to 3 decimals.
Endpoint: GET /api/v1/mining/blocks/fee-rates/{time_period}/precise
def get_block_sizes_weights(time_period: TimePeriod) -> BlockSizesWeightsBlock sizes and weights.
Get average block sizes and weights for a time period.
Endpoint: GET /api/v1/mining/blocks/sizes-weights/{time_period}
def get_mempool_blocks() -> List[MempoolBlock]Projected mempool blocks.
Projected blocks for fee estimation. Block 0 reflects Bitcoin Core's actual next-block selection; blocks 1+ are a fee-tier approximation.
Endpoint: GET /api/v1/fees/mempool-blocks
def get_recommended_fees() -> RecommendedFeesRecommended fees.
Recommended fee rates by confirmation target, in whole sat/vB.
Endpoint: GET /api/v1/fees/recommended
def get_precise_fees() -> PreciseRecommendedFeesRecommended fee rates (precise).
Recommended fee rates by confirmation target, with up to three decimal places and support for sub-sat/vB rates.
Endpoint: GET /api/v1/fees/precise
def get_mempool() -> MempoolInfoMempool statistics.
Endpoint: GET /api/mempool
def get_mempool_txids() -> List[Txid]Mempool transaction IDs.
Get all transaction IDs currently in the mempool.
Endpoint: GET /api/mempool/txids
def get_mempool_recent() -> List[MempoolRecentTx]Recent mempool transactions.
Get the last 10 transactions to enter the mempool.
Endpoint: GET /api/mempool/recent
def get_replacements() -> List[ReplacementNode]Recent RBF replacements.
Returns up to 25 most-recent RBF replacement trees across the whole mempool. Each entry has the shape of replacements in GET /api/v1/tx/{txid}/rbf.
Endpoint: GET /api/v1/replacements
def get_fullrbf_replacements() -> List[ReplacementNode]Recent full-RBF replacements.
Same response shape as GET /api/v1/replacements, but limited to trees where at least one predecessor was non-signaling (full-RBF).
Endpoint: GET /api/v1/fullrbf/replacements
def get_mempool_block(index: MempoolBlockIndex) -> MempoolBlockContentProjected mempool block.
A projected mempool block with its transactions in order and its stats, by position as GET /api/v1/fees/mempool-blocks lists them: 0 is the next block, Bitcoin Core's getblocktemplate selection, and the only one served for now (others answer 404). The returned hash is an opaque content token: poll GET /api/mempool-blocks/{index}/diff/{hash} to follow changes instead of refetching the block.
Endpoint: GET /api/mempool-blocks/{index}
def get_mempool_block_diff(index: MempoolBlockIndex,
since: MempoolBlockHash) -> MempoolBlockDiffProjected mempool block changes.
The projected mempool block's changes since the client's copy at since. order is the new block in order: each entry is either [start, count], the client's transactions start..start + count kept in order, or a transaction object, a body to place there. Walk order once to rebuild, and replace the cached stats with the response's; removed lists the txids that left, so clients can evict cached bodies. Use the response hash as the next since; with If-None-Match an unchanged block answers 304. Returns 404 when since has aged out of server history: fetch GET /api/mempool-blocks/{index} again.
Endpoint: GET /api/mempool-blocks/{index}/diff/{since}
def get_txid_by_index(index: TxIndex) -> TxidTxid by index.
Retrieve the transaction ID (txid) at a given global transaction index. Returns the txid as plain text.
Endpoint: GET /api/tx-index/{index}
def get_cpfp(txid: Txid) -> CpfpCPFP info.
Returns ancestors and descendants for a CPFP (Child Pays For Parent) transaction, including the effective fee rate of the package. A mempool transaction answers its live package; a confirmed one its package among its block's transactions; an unknown transaction, or a confirmed one without relatives in its block, {"ancestors":[]}.
Endpoint: GET /api/v1/cpfp/{txid}
def get_tx_rbf(txid: Txid) -> RbfResponseRBF replacement history.
Returns the RBF replacement tree for a transaction, if any. Both replacements and replaces are null when the tx has no known RBF history within the mempool monitor's retention window.
Endpoint: GET /api/v1/tx/{txid}/rbf
def get_tx(txid: Txid) -> TransactionTransaction information.
Endpoint: GET /api/tx/{txid}
def get_tx_hex(txid: Txid) -> HexTransaction hex.
Hex-encoded serialized transaction.
Endpoint: GET /api/tx/{txid}/hex
def get_tx_merkleblock_proof(txid: Txid) -> HexTransaction merkleblock proof.
Get the merkleblock proof for a transaction (BIP37 format, hex encoded).
Endpoint: GET /api/tx/{txid}/merkleblock-proof
def get_tx_merkle_proof(txid: Txid) -> MerkleProofTransaction merkle proof.
Endpoint: GET /api/tx/{txid}/merkle-proof
def get_tx_outspend(txid: Txid, vout: Vout) -> TxOutspendOutput spend status.
Whether the output has been spent and, if so, the spending transaction details. An output no known transaction holds is unspent.
Endpoint: GET /api/tx/{txid}/outspend/{vout}
def get_tx_outspends(txid: Txid) -> List[TxOutspend]All output spend statuses.
Spend statuses in output-index order.
Endpoint: GET /api/tx/{txid}/outspends
def get_tx_raw(txid: Txid) -> bytesTransaction raw.
Returns a transaction as binary data.
Endpoint: GET /api/tx/{txid}/raw
def get_tx_status(txid: Txid) -> TxStatusTransaction status.
Retrieve the confirmation status of a transaction. Returns whether the transaction is confirmed and, if so, the block height, hash, and timestamp. A transaction not in the chain, pending or unknown, is {"confirmed":false}.
Endpoint: GET /api/tx/{txid}/status
def get_transaction_times(txids: List[Txid]) -> List[Timestamp]Transaction first-seen times.
First-seen UNIX timestamps in seconds, in request order, of transactions in the mempool or that recently left it other than by replacement (mined ones included); 0 otherwise.
Endpoint: GET /api/v1/transaction-times
def post_tx(body: str) -> TxidBroadcast transaction.
Submit a raw transaction as hexadecimal text (at most 8,000,000 request bytes, including whitespace). Returns its txid as plain text. No responses are cached. Cancellation or a transport error after dispatch may leave the submission outcome unknown; do not automatically retry.
Endpoint: POST /api/tx
def get_utxo_set_latest() -> UtxoSetLatest UTXO set.
The UTXO set after the latest published block, in the layout of GET /api/utxo-set/{point}.
Endpoint: GET /api/utxo-set
def get_utxo_set(point: HeightOrDate) -> UtxoSetUTXO set at block height or date.
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.
Endpoint: GET /api/utxo-set/{point}
def get_utxo_set_diff(point: HeightOrDate) -> UtxoSetDiffUTXO set changes of a block or date.
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.
Endpoint: GET /api/utxo-set/{point}/diff
def get_live_price() -> DollarsLive BTC/USD price.
Current BTC/USD price in dollars, derived from on-chain round-dollar output patterns in the oracle's recent-block window, with the mempool's outputs blended in when available, to the cent: price of GET /api/oracle/live. Confirmed per-height history is available at GET /api/series/price/height. Not found before the oracle's first prices.
Endpoint: GET /api/oracle/price
def get_oracle_live() -> OracleBlockThe oracle now.
The oracle's reading now, as GET /api/oracle/blocks/{height} reads a block: with the mempool's outputs blended in as the next block (mempool true, height the next block's, outputs the mempool's), its search from the tip's answer, price the live price; without a mempool at the tip, the tip block's own. One snapshot: its parts never from two moments, hash the confirmed tip it was read at. Not found before the oracle's first prices, nor before height 508,000.
Endpoint: GET /api/oracle/live
def get_oracle_block(height: Height) -> OracleBlockThe oracle at a block.
How the oracle read a confirmed block, after height 508,000: what it counted (the smoothed histogram of the payments of the block and the 11 before it, by amount on its log scale; the block's outputs as its filter judged them, each skipped one under the first rule that skips it), where it looked (every candidate bin in its window, 12 below the block before's answer to 11 above, with its score) and what it found (the bin it picked and its price). Bins: 200 a decade, a bin round(log10(sats) * 200); as where $100 lands, a bin is the price 10^(10 - bin / 200) dollars. A settled block's never changes.
Endpoint: GET /api/oracle/blocks/{height}
def get_oracle_payments(start: Height) -> OraclePaymentsThe oracle's payments, 144 blocks at a time.
For each of the 144 blocks from start (a multiple of 144, else a bad request; from 508,032, earlier ones out of range): its payments as the oracle filters them, each read as each of its 19 round-dollar amounts ($1 to $10,000) at its exact amount in sats, counted by the price each reading implies, in buckets a tenth of a bin wide (0.115% of price) over the block's search window: finer than the oracle's bins, the evidence behind its prices. The chunk at the tip holds its blocks so far, hash its last block's; a whole, settled chunk never changes.
Endpoint: GET /api/oracle/payments/{start}
def get_openapi() -> AnyOpenAPI specification.
Full OpenAPI 3.1 specification for this API. Build tools from this document.
Endpoint: GET /openapi.json
def get_api() -> AnyCompact API summary.
Compact custom summary of the OpenAPI specification for LLM reading: types instead of schemas, returns instead of responses, no examples; parameters keep their enum, default and bounds. Not valid OpenAPI: build tools from GET /openapi.json.
Endpoint: GET /api.json