Quickstart Guide
On this page

Quickstart Guide

Get up and running with Bitcoin API in 2 minutes.

Get up and running with Bitcoin API in 2 minutes.

Step 1: Create an Account

Sign up for free. You can register with your email or use Google sign-in.

Step 2: Get Your API Key

Go to your profile and grab the default API key.

Your API key can be used as a secret in server-side applications. It can also be used directly in client-side code (web browsers), but in that case, you must configure per-IP rate limits in your key settings to prevent abuse.

Step 3: Make Your First Request

Let’s fetch the current Bitcoin price. Run this in your browser console or any JavaScript runtime:

const response = await fetch(
  'https://bitcoin-api.net/v1/prices/current?symbol=btcusdt',
  { headers: { Authorization: 'Bearer YOUR_API_KEY' } }
);
const data = await response.json();
console.log(data);

You should see a response like this:

{
  "price": "67482.35",
  "time": "2025-04-12T14:32:05.000Z"
}

Or connect to WebSocket

Want real-time price updates? Open a WebSocket connection. Run this in your browser console or any JavaScript runtime:

const ws = new WebSocket(
  'wss://bitcoin-api.net/v1/prices/current?symbol=btcusdt&apiKey=YOUR_API_KEY'
);

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log(data);
};

You’ll receive JSON messages with updated prices as they come in from the exchange.