Files
brk/modules/brk-client
2026-04-01 21:11:20 +02:00
..
2026-03-29 17:32:44 +02:00
2026-03-23 16:45:20 +01:00
2025-12-29 09:37:57 +01:00
2026-01-13 22:32:29 +01:00
2026-04-01 21:11:20 +02:00
2025-10-01 23:17:48 +02:00
2026-03-29 17:47:47 +02:00
2026-01-24 19:22:03 +01:00
2026-03-23 16:45:20 +01:00

brk-client

JavaScript/TypeScript client for the Bitcoin Research Kit API.

Zero dependencies.

npm | API Reference

Installation

npm install brk-client

Or just copy index.js into your project - it's a single file with no dependencies.

Quick Start

import { BrkClient } from 'brk-client';

// Use the free public API or your own instance
const client = new BrkClient('https://bitview.space');
// or: `const client = new BrkClient({ baseUrl: 'https://bitview.space', timeout: 10000 });`

// Blockchain data (mempool.space compatible)
const block = await client.getBlockByHeight(800000);
const tx = await client.getTx('abc123...');
const address = await client.getAddress('bc1q...');

// Metrics API - typed, chainable
const prices = await client.metrics.price.usd.split.close
  .by.dateindex
  .last(30); // Last 30 items

// Generic metric fetching
const data = await client.getMetric('price_close', 'dateindex', -30);