Real-time Bitcoin hashprice in USD and BTC per terahash per day. No API key, no signup, no rate limits. Use it in your dashboard, bot, or app.
✓ No key required ⛏ Powered by dmnd.workReturns the current Bitcoin hashprice derived from live BTC price, network difficulty, and average block fees. Data is cached for 60 seconds. Sources: CoinGecko (primary), Coinbase (fallback), blockchain.info, mempool.space.
| Field | Type | Description |
|---|---|---|
| priceUSD | float | Hashprice in USD per TH per day |
| priceBTC | float | Hashprice in BTC per TH per day |
| pricePerPH | float | Hashprice in USD per PH per day |
| btcPrice | float | Current BTC/USD spot price |
| difficulty | float | Current network difficulty |
| avgFeesBTC | float | Average block fees over last 6 blocks (BTC) |
| timestamp | string | ISO 8601 timestamp of the response |
| source | string | "stratumv2.com" |
| powered_by | string | "dmnd.work — Stratum V2 Bitcoin Mining Pool" |
| docs | string | URL to this page |
// Fetch current hashprice
const res = await fetch('https://stratumv2.com/api/hashprice');
const data = await res.json();
console.log(`Hashprice: $${data.priceUSD.toFixed(6)}/TH/day`);
console.log(`Per PH: $${data.pricePerPH.toFixed(4)}/PH/day`);
console.log(`BTC: $${data.btcPrice.toLocaleString()}`);
import requests
data = requests.get('https://stratumv2.com/api/hashprice').json()
print(f"Hashprice: ${data['priceUSD']:.6f}/TH/day")
print(f"Per PH: ${data['pricePerPH']:.4f}/PH/day")
print(f"BTC: ${data['btcPrice']:,.0f}")
curl https://stratumv2.com/api/hashprice
{
"priceUSD": 0.0297556299,
"priceBTC": 0.0000004334,
"pricePerPH": 29.7556,
"btcPrice": 68653.00,
"difficulty": 114494789739471,
"avgFeesBTC": 0.000412,
"timestamp": "2026-03-14T12:00:00.000Z",
"source": "stratumv2.com",
"powered_by": "dmnd.work — Stratum V2 Bitcoin Mining Pool",
"docs": "https://stratumv2.com/api-docs"
}
Hashprice represents the expected daily revenue per terahash of mining power, before electricity costs.
// Standard hashprice formula
priceUSD = (86400 × (subsidy + avgFees) × btcPrice × 10¹²)
÷ (difficulty × 2³²)
// Where:
// 86400 = seconds per day
// subsidy = 3.125 BTC (post-halving block reward)
// avgFees = average fees per block over last 6 blocks
// 10¹² = TH/s to H/s conversion
// 2³² = difficulty target constant
Data refreshes every 60 seconds. BTC price sourced from CoinGecko with Coinbase fallback.
This API is free to use. If you use it in a public project, a mention is appreciated — add a powered_by credit linking to stratumv2.com or dmnd.work.
<!-- Suggested attribution -->
Hashprice data by <a href="https://stratumv2.com">stratumv2.com</a>
Powered by <a href="https://dmnd.work">dmnd.work</a> — Stratum V2 Mining Pool