{"openapi":"3.1.0","info":{"title":"Bitcoin Hashrate & Difficulty API","version":"1.0.0","description":"Bitcoin's network-security and mining-economics layer, live and keyless, powered by mempool.space — hashrate, mining difficulty, the difficulty-adjustment countdown, the halving countdown and per-window block-reward economics. These are the numbers that describe how hard Bitcoin is to mine and how secure the chain is, not a price and not a block explorer. The difficulty endpoint is the flagship: the current mining difficulty plus the live adjustment countdown — how far through the current 2016-block epoch we are, the projected size of the next adjustment (Bitcoin retargets every two weeks so blocks stay ~10 minutes apart), the blocks remaining to the retarget, the estimated retarget date and the realised average block time. The hashrate endpoint returns the current network hashrate in EH/s plus a historical hashrate-and-difficulty timeseries over a chosen window (1m to all). The halving endpoint is the countdown to the next block-subsidy halving — the current block height, the current subsidy in BTC, the next halving block and how many blocks and days remain. The rewards endpoint returns block-reward economics over a recent window: the total miner reward, the fee share, and the per-block averages, all in BTC. This is the Bitcoin difficulty / hashrate / halving cut — distinct from the Bitcoin block-explorer feed (mempool, fees, blocks, addresses, transactions), the mining-pool-distribution feed (who finds the blocks and how centralised), and the multi-coin mining-profitability feed. Hashrate in EH/s, difficulty raw and in trillions, rewards in BTC, times in UTC. No key, nothing stored.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/hashrate-api","description":"oanor gateway"}],"tags":[{"name":"Difficulty"},{"name":"Hashrate"},{"name":"Halving"},{"name":"Rewards"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/difficulty":{"get":{"operationId":"get_v1_difficulty","tags":["Difficulty"],"summary":"Current difficulty + next-adjustment countdown","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Bitcoin's mining difficulty and the live difficulty-adjustment countdown. Bitcoin retargets difficulty every 2016 blocks (~2 weeks) so blocks average ~10 minutes: epoch_progress_pct is how far through the current epoch we are, estimated_change_pct the projected size of the next adjustment (positive = mining gets harder), remaining_blocks how many until the retarget, and avg_block_time_seconds the realised block time this epoch (under 600s pushes difficulty up). Live, cached ~60s.","source":"mempool.space public API (v1/difficulty-adjustment), keyless","direction":"easier","remaining_blocks":160,"current_difficulty":138955357012247.3,"epoch_progress_pct":92.06,"previous_change_pct":1.72,"estimated_change_pct":-10.32,"next_retarget_height":953568,"avg_block_time_seconds":669,"estimated_retarget_date":"2026-06-14T01:20:55.640Z","current_difficulty_trillions":138.96},"meta":{"timestamp":"2026-06-12T19:35:55.505Z","request_id":"bae52145-4bdd-409b-aca7-60fc57defa5d"},"status":"ok","message":"Difficulty retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/hashrate":{"get":{"operationId":"get_v1_hashrate","tags":["Hashrate"],"summary":"Network hashrate (EH/s) now and as a timeseries","description":"","parameters":[{"name":"period","in":"query","required":false,"description":"Window: 1m, 3m, 6m, 1y, 2y, 3y, all","schema":{"type":"string"},"example":"1y"},{"name":"limit","in":"query","required":false,"description":"Most-recent points (1-365)","schema":{"type":"string"},"example":"30"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Bitcoin's network hashrate — the total computing power securing the chain, in EH/s (exahashes per second) — now and as a daily timeseries over the chosen window. A rising hashrate means more miners and a more secure, harder-to-attack chain. Pass period (1m, 3m, 6m, 1y, 2y, 3y, all; default 1y) and limit (1-365 most-recent points, default 30). Live, cached ~60s.","period":"1y","points":30,"source":"mempool.space public API (v1/mining/hashrate), keyless","history":[{"date":"2026-06-12T00:00:00.000Z","hashrate_ehs":932.13},{"date":"2026-06-11T00:00:00.000Z","hashrate_ehs":852.17},{"date":"2026-06-10T00:00:00.000Z","hashrate_ehs":860.83},{"date":"2026-06-09T00:00:00.000Z","hashrate_ehs":898.39},{"date":"2026-06-08T00:00:00.000Z","hashrate_ehs":806.9},{"date":"2026-06-07T00:00:00.000Z","hashrate_ehs":830.23},{"date":"2026-06-06T00:00:00.000Z","hashrate_ehs":926.82},{"date":"2026-06-05T00:00:00.000Z","hashrate_ehs":990.52},{"date":"2026-06-04T00:00:00.000Z","hashrate_ehs":752.89},{"date":"2026-06-03T00:00:00.000Z","hashrate_ehs":759.81},{"date":"2026-06-02T00:00:00.000Z","hashrate_ehs":922.21},{"date":"2026-06-01T00:00:00.000Z","hashrate_ehs":1007.69},{"date":"2026-05-31T00:00:00.000Z","hashrate_ehs":977.27},{"date":"2026-05-30T00:00:00.000Z","hashrate_ehs":959.21},{"date":"2026-05-29T00:00:00.000Z","hashrate_ehs":1101.45},{"date":"2026-05-28T00:00:00.000Z","hashrate_ehs":949.12},{"date":"2026-05-27T00:00:00.000Z","hashrate_ehs":940.36},{"date":"2026-05-26T00:00:00.000Z","hashrate_ehs":1130.4},{"date":"2026-05-25T00:00:00.000Z","hashrate_ehs":886.35},{"date":"2026-05-24T00:00:00.000Z","hashrate_ehs":1112.35},{"date":"2026-05-23T00:00:00.000Z","hashrate_ehs":1063.88},{"date":"2026-05-22T00:00:00.000Z","hashrate_ehs":853.86},{"date":"2026-05-21T00:00:00.000Z","hashrate_ehs":1042.27},{"date":"2026-05-20T00:00:00.000Z","hashrate_ehs":962.93},{"date":"2026-05-19T00:00:00.000Z","hashrate_ehs":936.48},{"date":"2026-05-18T00:00:00.000Z","hashrate_ehs":960.35},{"date":"2026-05-17T00:00:00.000Z","hashrate_ehs":1029.77},{"date":"2026-05-16T00:00:00.000Z","hashrate_ehs":968.7},{"date":"2026-05-15T00:00:00.000Z","hashrate_ehs":987.45},{"date":"2026-05-14T00:00:00.000Z","hashrate_ehs":916.31}],"current_hashrate_ehs":882.51,"current_difficulty_trillions":138.96},"meta":{"timestamp":"2026-06-12T19:35:55.629Z","request_id":"9a47c8c9-d1ea-4299-8f9a-552cf32c5336"},"status":"ok","message":"Hashrate retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/halving":{"get":{"operationId":"get_v1_halving","tags":["Halving"],"summary":"Countdown to the next block-subsidy halving","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"The countdown to Bitcoin's next block-subsidy halving. Every 210,000 blocks (~4 years) the reward miners get for each block halves, tightening Bitcoin's issuance — this gives the current block height, the current subsidy in BTC, the next halving's block height, and how many blocks (and roughly how many days, at ~10 min/block) remain. estimated_days_remaining is an approximation from the fixed block target. Live, cached ~60s.","source":"mempool.space public API (blocks/tip/height) + Bitcoin consensus, keyless","progress_pct":54,"current_height":953408,"halvings_so_far":4,"blocks_remaining":96592,"next_subsidy_btc":1.5625,"next_halving_height":1050000,"next_halving_number":5,"estimated_halving_date":"2028-04-13T14:15:55.720Z","estimated_days_remaining":670.8,"current_block_subsidy_btc":3.125},"meta":{"timestamp":"2026-06-12T19:35:55.720Z","request_id":"4016d40b-ebb5-4c14-8228-aecd405c0145"},"status":"ok","message":"Halving retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/rewards":{"get":{"operationId":"get_v1_rewards","tags":["Rewards"],"summary":"Block-reward economics over a window of blocks","description":"","parameters":[{"name":"blocks","in":"query","required":false,"description":"Window size (1-1000)","schema":{"type":"string"},"example":"144"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Block-reward economics over a recent window of blocks: the total miner reward (subsidy + fees) in BTC, how much of it was transaction fees (total_fees_btc and fee_share_pct — fees matter more as the subsidy shrinks), and the per-block averages. Pass blocks (1-1000, default 144 ≈ one day). Live, cached ~60s.","source":"mempool.space public API (v1/mining/reward-stats), keyless","end_block":953408,"start_block":953265,"fee_share_pct":0.98,"window_blocks":144,"total_fees_btc":4.46120723,"total_reward_btc":454.46120723,"total_subsidy_btc":450,"total_transactions":609372,"avg_fees_per_block_btc":0.03098061,"avg_reward_per_block_btc":3.15598061},"meta":{"timestamp":"2026-06-12T19:35:55.836Z","request_id":"bf148722-3181-41ee-a2de-bf80c62b7273"},"status":"ok","message":"Reward stats retrieved successfully","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Service metadata","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"difficulty, halving and meta take no parameters. hashrate takes period (1m/3m/6m/1y/2y/3y/all, default 1y) and limit (1-365, default 30). rewards takes blocks (1-1000, default 144). Hashrate is in EH/s, difficulty in raw and trillions, rewards in BTC (from satoshis), times in UTC ISO-8601. A short ~60-second protective cache fronts the upstream.","source":"mempool.space public API, keyless, live","service":"hashrate-api","endpoints":{"GET /v1/meta":"This document.","GET /v1/halving":"Countdown to the next block-subsidy halving (height, subsidy, blocks/days left).","GET /v1/rewards":"Block-reward economics over a window — subsidy, fees, fee share (blocks).","GET /v1/hashrate":"Network hashrate in EH/s, now and as a timeseries (period, limit).","GET /v1/difficulty":"Current difficulty + the next-adjustment countdown (progress, projected change, blocks left)."},"description":"Bitcoin's network-security and mining-economics layer, live and keyless: hashrate, mining difficulty, the difficulty-adjustment countdown, the halving countdown and per-window block-reward economics, from mempool.space. The difficulty endpoint gives the current difficulty and the live adjustment countdown (epoch progress, projected change, blocks to retarget); hashrate gives the network hashrate in EH/s plus a historical timeseries; halving counts down to the next subsidy halving (height, subsidy, blocks/days remaining); rewards gives block-reward economics (subsidy, fees, fee share). The Bitcoin difficulty / hashrate / halving cut — distinct from the Bitcoin block-explorer feed (mempool, fees, blocks, addresses), the mining-pool-distribution feed (who finds blocks), and the multi-coin mining-profitability feed.","upstream_status":"ok","sample_difficulty":{"epoch_progress_pct":92.06,"estimated_change_pct":-10.32}},"meta":{"timestamp":"2026-06-12T19:35:55.947Z","request_id":"295c01fb-77bf-4957-881e-2e29bae33677"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":600,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":2700,"monthly_call_quota":28000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":8700,"monthly_call_quota":140000,"rps_limit":16,"hard_limit":true},{"slug":"scale","name":"Scale","price_cents_month":23900,"monthly_call_quota":640000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/hashrate-api"}