Getting Started

Quick Start

Get up and running with the BlockFuze API in minutes. This guide covers everything you need to start making authenticated API calls.

1. Get Your API Keys

Obtain your API keys from the BlockFuze dashboard:

  • Public Key — Used to identify your account in requests
  • Private Key — Used to sign requests (keep this secret!)

2. Base URL

All API requests should be made to:

url
https://api.blockfuze.com

3. Code Examples

Complete examples 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/Account/Balance');
console.log(balance);

4. Request Types

  • GET Requests

    Sign the query string without the leading "?". Sign an empty string if no params.

  • POST Requests

    Sign the raw JSON body string exactly as it will be sent in the request.

Next Steps

Learn more about authentication or explore the API endpoints.