API Documentation
Playground

API Documentation

Complete reference for integrating with the BlockFuze API. All endpoints require HMAC-SHA512 authentication.

Base URL

All API requests should be made to:

url
https://api.blockfuze.com

Quick Start

Get up and running with the BlockFuze API in minutes. Below are complete examples in multiple languages showing how to authenticate and make requests.

node.js
const crypto = require('crypto');

const PUBLIC_KEY = 'your-public-key';
const PRIVATE_KEY = 'your-private-key';
const BASE_URL = 'https://api.blockfuze.com';

function createSignature(payload, privateKey) {
  return crypto
    .createHmac('sha512', privateKey)
    .update(payload)
    .digest('hex');
}

async function makeGetRequest(endpoint, queryParams = {}) {
  const queryString = new URLSearchParams(queryParams).toString();
  const signature = createSignature(queryString, PRIVATE_KEY);

  const url = queryString
    ? `${BASE_URL}${endpoint}?${queryString}`
    : `${BASE_URL}${endpoint}`;

  const response = await fetch(url, {
    method: 'GET',
    headers: {
      'x-public-key': PUBLIC_KEY,
      'x-signature': signature,
    },
  });

  return response.json();
}

async function makePostRequest(endpoint, body = {}) {
  const bodyString = JSON.stringify(body);
  const signature = createSignature(bodyString, PRIVATE_KEY);

  const response = await fetch(`${BASE_URL}${endpoint}`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-public-key': PUBLIC_KEY,
      'x-signature': signature,
    },
    body: bodyString,
  });

  return response.json();
}

const balance = await makeGetRequest('/Api/Balance');
console.log(balance);

Try the API Playground

Test endpoints in real-time with our interactive playground. No code required.

GET Requests

For GET requests, create the signature from the query string without the leading "?". If there are no query parameters, sign an empty string.

POST Requests

For POST requests, create the signature from the raw JSON body string exactly as it will be sent in the request body.