Bitview General API
Difficulty adjustments and BTC/USD price data. *[Mempool.space](https://mempool.space/docs/api/rest) compatible.*
Difficulty adjustments and BTC/USD price data. *[Mempool.space](https://mempool.space/docs/api/rest) compatible.*
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/bitview-space:bitview-space-general-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Bitview General API
description: 'Bitview is a free, open-source Bitcoin data server: on-chain metrics, blocks, mempool and mining data, with charts and an API, at bitview.space or beside your own Bitcoin Core node.
API for querying Bitcoin blockchain data, mempool state, and on-chain series.
### Features
- **Mempool.space compatible**: Blocks, transactions, addresses, mining, fees, and mempool endpoints match the mempool.space REST API
- **Series**: Thousands of on-chain time-series across multiple indexes (date, block height, etc.)
- **Multiple formats**: JSON and CSV output
- **For LLMs**: `/llms.txt` for discovery, `/api.json` a compact custom summary of this spec for reading (not OpenAPI); build tools from `/openapi.json`
- **MCP**: Stateless, read-only access to these operations at mcp.bitview.space, with no authentication required
### Quick start
```bash
curl -s https://bitview.space/api/blocks/tip/height
curl -s https://bitview.space/api/v1/fees/recommended
curl -s https://bitview.space/api/mempool
curl -s https://bitview.space/api/series/search?q=price
```
### Errors
Errors use `application/problem+json`:
```json
{
"error": {
"type": "not_found",
"code": "series_not_found",
"message": "''foo'' not found, did you mean ''bar''? What became of it: /changes/?id=foo",
"doc_url": "/api"
}
}
```
- **`type`**: Error category, following the status — `invalid_request` (4xx other than 404), `not_found` (404), `unavailable` (503), `timeout` (504), or `internal` (other 5xx); see the `ErrorType` schema
- **`code`**: Machine-readable error code (e.g. `invalid_address`, `series_not_found`, `weight_exceeded`); see the `ErrorCode` schema
### Client Libraries
- JavaScript
- Python
- Rust
- MCP
### Links
- GitHub
- Bitview Studio - Charts of any series, built on this API'
termsOfService: https://bitview.space/terms/
contact:
name: Bitview
url: https://bitview.space/support/
email: support@bitview.space
license:
name: MIT
url: https://github.com/bitcoinresearchkit/mono/blob/main/LICENSE
version: v0.13.0
x-privacy-policy: https://bitview.space/privacy/
tags:
- name: General
description: 'Difficulty adjustments and BTC/USD price data.
*Mempool.space compatible.*'
paths:
/api/v1/difficulty-adjustment:
get:
tags:
- General
summary: Difficulty adjustment
description: 'Get current difficulty adjustment progress and estimates.
*Mempool.space docs*'
operationId: get_difficulty_adjustment
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/DifficultyAdjustment'
'304':
description: 'Not modified: the request''s validator matches the current representation'
'400':
description: Invalid request parameters
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'500':
description: Internal server error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'503':
description: Service temporarily unavailable
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'504':
description: Request deadline exceeded
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
/api/v1/prices:
get:
tags:
- General
summary: Current BTC price
description: 'Returns bitcoin latest price (on-chain derived, USD only).
*Mempool.space docs*'
operationId: get_prices
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/PricePoint'
'304':
description: 'Not modified: the request''s validator matches the current representation'
'400':
description: Invalid request parameters
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'500':
description: Internal server error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'503':
description: Service temporarily unavailable
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'504':
description: Request deadline exceeded
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
/api/v1/historical-price:
get:
tags:
- General
summary: Historical price
description: 'Completed four-hour BTC/USD closes, newest first as mempool.space lists them, labeled by interval end, from the first priced interval (2010-08-16). With a UNIX timestamp, returns the latest nonempty completed close at or before it; before the first close returns an empty list. The current partial interval is excluded. USD only (`currency` accepts `USD`); exchangeRates is empty.
*Mempool.space docs*'
operationId: get_historical_price
parameters:
- in: query
name: timestamp
description: 'UNIX timestamp: the latest close at or before it'
schema:
description: 'UNIX timestamp: the latest close at or before it'
default: null
$ref: '#/components/schemas/Timestamp'
style: form
- in: query
name: currency
description: 'Quote currency: USD, the only one served'
schema:
description: 'Quote currency: USD, the only one served'
$ref: '#/components/schemas/Currency'
style: form
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/HistoricalPrice'
'304':
description: 'Not modified: the request''s validator matches the current representation'
'400':
description: Invalid request parameters
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'500':
description: Internal server error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'503':
description: Service temporarily unavailable
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
'504':
description: Request deadline exceeded
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ErrorBody'
components:
schemas:
Currency:
description: 'A quote currency prices are served in: USD only.'
type: string
enum:
- USD
ErrorDetail:
type: object
properties:
type:
description: Error category, following the HTTP status
allOf:
- $ref: '#/components/schemas/ErrorType'
code:
description: Machine-readable error code
allOf:
- $ref: '#/components/schemas/ErrorCode'
message:
description: Human-readable description
type: string
doc_url:
description: Link to API documentation
type: string
format: uri-reference
required:
- type
- code
- message
- doc_url
Height:
description: 'A block height: how many blocks came before it.'
type: integer
format: uint32
minimum: 0
examples:
- 0
- 210000
- 420000
- 840000
Dollars:
description: An amount in US dollars.
type: number
format: double
examples:
- 0.0
- 100.5
- 30000.0
- 69000.0
- 84342.12
PricePoint:
description: 'A BTC/USD price at a time: the current price (`/api/v1/prices`) or one historical close'
type: object
properties:
time:
description: Unix timestamp
allOf:
- $ref: '#/components/schemas/Timestamp'
USD:
description: BTC/USD price
allOf:
- $ref: '#/components/schemas/Dollars'
required:
- time
- USD
ErrorCode:
type: string
enum:
- not_found
- invalid_address
- invalid_network
- unsupported_type
- no_series
- series_unsupported_index
- weight_exceeded
- too_many_utxos
- limit_exceeded
- unknown_after_txid
- unknown_address
- unknown_txid
- unknown_pool
- out_of_range
- unindexable_date
- no_data
- series_not_found
- mempool_not_available
- state_updating
- internal_error
- bad_request
- overloaded
- timeout
- method_not_allowed
DifficultyAdjustment:
type: object
properties:
progressPercent:
description: Progress through current difficulty epoch (0-100%)
type: number
format: double
examples:
- 44.4
difficultyChange:
description: Estimated difficulty change at next retarget at the `adjustedTimeAvg` pace (%)
type: number
format: double
examples:
- 2.5
estimatedRetargetDate:
description: Estimated timestamp of next retarget (milliseconds)
type: integer
format: uint64
minimum: 0
examples:
- 1627762478000
remainingBlocks:
description: Blocks remaining until retarget
type: integer
format: uint32
minimum: 0
examples:
- 1121
remainingTime:
description: Estimated time until retarget at `adjustedTimeAvg` (milliseconds)
type: integer
format: uint64
minimum: 0
examples:
- 665977000
previousRetarget:
description: Previous difficulty adjustment (%)
type: number
format: double
examples:
- -4.8
previousTime:
description: Timestamp of most recent retarget (seconds)
examples:
- 1627000000
allOf:
- $ref: '#/components/schemas/Timestamp'
nextRetargetHeight:
examples:
- 741888
allOf:
- $ref: '#/components/schemas/Height'
timeAvg:
description: Average block time in current epoch (milliseconds)
type: integer
format: uint64
minimum: 0
examples:
- 580000
adjustedTimeAvg:
description: 'Block time the projection uses (milliseconds): `timeAvg`, except in an epoch''s first 503
blocks, where it spans the last 503 blocks, those before the retarget scaled by it'
type: integer
format: uint64
minimum: 0
examples:
- 580000
timeOffset:
description: 'Testnet''s offset for its 20-minute minimum-difficulty rule (milliseconds): always 0 on
mainnet, as mempool.space'
type: integer
format: int64
examples:
- 0
expectedBlocks:
description: Blocks expected at the 10-minute target between the epoch's first block and the tip block
type: number
format: double
examples:
- 1827.21
required:
- progressPercent
- difficultyChange
- estimatedRetargetDate
- remainingBlocks
- remainingTime
- previousRetarget
- previousTime
- nextRetargetHeight
- timeAvg
- adjustedTimeAvg
- timeOffset
- expectedBlocks
HistoricalPrice:
type: object
properties:
prices:
type: array
items:
$ref: '#/components/schemas/PricePoint'
exchangeRates:
description: Exchange rates (currently empty)
allOf:
- $ref: '#/components/schemas/ExchangeRates'
required:
- prices
- exchangeRates
ErrorType:
description: 'Error category, following the HTTP status: `invalid_request` (4xx other than 404),
`not_found` (404), `unavailable` (503; `Retry-After` when transient), `timeout` (504), `internal`
(other 5xx).'
type: string
enum:
- invalid_request
- not_found
- unavailable
- timeout
- internal
ExchangeRates:
description: 'Always empty: prices are quoted in USD only.'
type: object
additionalProperties: false
Timestamp:
description: A Unix timestamp, in seconds.
type: integer
format: uint32
minimum: 0
examples:
- 1231006505
- 1672531200
- 1713571200
- 1743631892
- 1759000868
ErrorBody:
description: The JSON body of every API error (`application/problem+json`).
type: object
properties:
error:
$ref: '#/components/schemas/ErrorDetail'
required:
- error