mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 14:49:58 -07:00
brk-client
Python client for the Bitcoin Research Kit API.
Installation
pip install brk-client
# or
uv add brk-client
Quick Start
from brk_client import BrkClient
# Use the free public API or your own instance
client = BrkClient("https://bitview.space")
# Blockchain data (mempool.space compatible)
block = client.get_block_by_height(800000)
tx = client.get_tx("abc123...")
address = client.get_address("bc1q...")
# Metrics API - typed, chainable
prices = client.metrics.price.usd.split.close \
.by.dateindex() \
.tail(30) \
.fetch() # Last 30 items
# Generic metric fetching
data = client.get_metric("price_close", "dateindex", -30)
API
# Range methods
.head(n) # First n items
.tail(n) # Last n items
.fetch() # Execute the request
Configuration
client = BrkClient("https://bitview.space", timeout=60.0)