Bitcoin price tracker template

  • React
  • Vite

A live Bitcoin price in eight currencies, with the 24-hour change, high, low, market cap and volume.

A React app that shows the current Bitcoin price in US dollars, euros, pounds, yen and four more currencies. Pick a currency to see the price, the 24-hour change, high and low, the market cap and the trading volume. It refreshes every minute. Use it as a price widget, or lift the function to add prices to your own dashboard.

The bitcoin price tracker app running

What it does

Eight currencies
Switch between USD, EUR, GBP, JPY, CAD, AUD, CHF and CNY, formatted the way each currency is written.
The 24-hour picture
Shows the change, high and low over the last day, alongside the market cap and volume.
Refreshes itself
Fetches a new price every minute, or on demand with the Refresh button.
Keeps your key private
The page calls a Vercel function in api/, which holds the key, checks the input and limits each visitor to 10 refreshes a minute.
Runs locally in one command
npm run dev serves the page and runs the api/ functions together, the same way Vercel does, with no CLI to install.

How it works

The Vercel function: it checks the currency and calls Bitcoin Price.

api/price.js
import { guard, callApi, respond, fail } from '../lib/apiverve.js';

const CURRENCIES = ['USD', 'EUR', 'GBP', 'JPY', 'CAD', 'AUD', 'CHF', 'CNY'];

/** GET /api/price?currency=USD: the current Bitcoin price, 24h change, range and volume. */
export async function GET(request) {
  const blocked = guard(request);
  if (blocked) return blocked;

  const currency = new URL(request.url).searchParams.get('currency') || 'USD';
  if (!CURRENCIES.includes(currency)) return fail(`Currency must be one of ${CURRENCIES.join(', ')}`);

  return respond(() => callApi('bitcoin', { query: { currency } }));
}

See the whole file on GitHub

Deploy it

  1. Get a free API key

    The free plan includes 200 credits a month, no card needed. Create your key.

  2. Deploy it

    Click Deploy to Vercel. Vercel copies the repo to your GitHub account and asks for APIVERVE_API_KEY: paste your key there.

  3. Open your app

    Vercel builds it and gives you a live URL, usually in about a minute. Every push to the repo redeploys it.

Try the Bitcoin Price API — the call this template makes

Request
GETapi.apiverve.com/v1/bitcoin
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "currency": "USD",
    "price": 97250.43,
    "marketCap": 1928000000000,
    "volume24h": 35420000000,
    "change24h": -1.52,
    "lastUpdated": "2026-02-07T12:00:00.000Z",
    "high24h": 98750.21,
    "low24h": 96125.88,
    "changeDirection": "down",
    "formatted": {
      "price": "$97,250.43",
      "marketCap": "$1.93T",
      "volume": "$35.42B",
      "priceWords": "ninety-seven thousand two hundred fifty dollars"
    }
  }
}

Build your own with Bitcoin Price. Start with 200 free credits. One key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs