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.

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.
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 } }));
}Deploy it
- Get a free API key
The free plan includes 200 credits a month, no card needed. Create your key.
- Deploy it
Click Deploy to Vercel. Vercel copies the repo to your GitHub account and asks for
APIVERVE_API_KEY: paste your key there. - 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
No key required to try it. Get a key to use it in your app.
{
"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"
}
}
}