JSON over RESTful HTTP. Amounts are always represented in satoshis.
The blockstream.info public APIs are available at:
- Bitcoin: https://blockstream.info/api/
- Bitcoin Testnet: https://blockstream.info/testnet/api/
- Liquid: https://blockstream.info/liquid/api/
For example:
$ curl https://blockstream.info/api/blocks/tip/hash
You can also self-host the Esplora API server, which provides better privacy and security.
Returns information about the transaction.
Available fields: txid
, version
, locktime
, size
, weight
, fee
, vin
, vout
and status
(see transaction format for details).
Returns the transaction confirmation status.
Available fields: confirmed
(boolean), block_height
(optional) and block_hash
(optional).
Returns the raw transaction in hex or as binary data.
Returns a merkle inclusion proof for the transaction using bitcoind's merkleblock format.
Note: This endpoint is not currently available for Liquid/Elements-based chains.
Returns a merkle inclusion proof for the transaction using
Electrum's blockchain.transaction.get_merkle
format.
Returns the spending status of a transaction output.
Available fields: spent
(boolean), txid
(optional), vin
(optional) and status
(optional, the status of the spending tx).
Returns the spending status of all transaction outputs.
Broadcast a raw transaction to the network.
The transaction should be provided as hex in the request body.
The txid
will be returned on success.
Get information about an address/scripthash.
Available fields: address
/scripthash
, chain_stats
and mempool_stats
.
{chain,mempool}_stats
each contain an object with tx_count
, funded_txo_count
, funded_txo_sum
, spent_txo_count
and spent_txo_sum
.
Elements-based chains don't have the {funded,spent}_txo_sum
fields.
Get transaction history for the specified address/scripthash, sorted with newest first.
Returns up to 50 mempool transactions plus the first 25 confirmed transactions.
You can request more confirmed transactions using :last_seen_txid
(see below).
Get confirmed transaction history for the specified address/scripthash, sorted with newest first.
Returns 25 transactions per page. More can be requested by specifying the last txid seen by the previous query.
Get unconfirmed transaction history for the specified address/scripthash.
Returns up to 50 transactions (no paging).
Get the list of unspent transaction outputs associated with the address/scripthash.
Available fields: txid
, vout
, value
and status
(with the status of the funding tx).
Elements-based chains have a valuecommitment
field that may appear in place of value
, plus the following additional fields: asset
/assetcommitment
, nonce
/noncecommitment
, surjection_proof
and range_proof
.
Search for addresses beginning with :prefix
.
Returns a JSON array with up to 10 results.
Returns information about a block.
Available fields: id
, height
, version
, timestamp
, mediantime
, bits
, nonce
, merkle_root
, tx_count
, size
, weight
, and previousblockhash
.
Elements-based chains have an additional proof
field.
See block format for more details.
The response from this endpoint can be cached indefinitely.
Returns the hex-encoded block header.
The response from this endpoint can be cached indefinitely.
Returns the block status.
Available fields: in_best_chain
(boolean, false for orphaned blocks), next_best
(the hash of the next block, only available for blocks in the best chain).
Returns a list of transactions in the block (up to 25 transactions beginning at start_index
).
Transactions returned here do not have the status
field, since all the transactions share the same block and confirmation status.
The response from this endpoint can be cached indefinitely.
Returns a list of all txids in the block.
The response from this endpoint can be cached indefinitely.
Returns the transaction at index :index
within the specified block.
The response from this endpoint can be cached indefinitely.
Returns the raw block representation in binary.
The response from this endpoint can be cached indefinitely.
Returns the hash of the block currently at height
.
Returns the 10 newest blocks starting at the tip or at start_height
if specified.
Returns the height of the last block.
Returns the hash of the last block.
Get mempool backlog statistics. Returns an object with:
-
count
: the number of transactions in the mempool -
vsize
: the total size of mempool transactions in virtual bytes -
total_fee
: the total fee paid by mempool transactions in satoshis -
fee_histogram
: mempool fee-rate distribution histogramAn array of
(feerate, vsize)
tuples, where each entry'svsize
is the total vsize of transactions paying more thanfeerate
but less than the previous entry'sfeerate
(except for the first entry, which has no upper bound). This matches the format used by the Electrum RPC protocol formempool.get_fee_histogram
.
Example output:
{
"count": 8134,
"vsize": 3444604,
"total_fee":29204625,
"fee_histogram": [[53.01, 102131], [38.56, 110990], [34.12, 138976], [24.34, 112619], [3.16, 246346], [2.92, 239701], [1.1, 775272]]
}
In this example, there are transactions weighting a total of 102,131 vbytes that are paying more than 53 sat/vB, 110,990 vbytes of transactions paying between 38 and 53 sat/vB, 138,976 vbytes paying between 34 and 38, etc.
Get the full list of txids in the mempool as an array.
The order of the txids is arbitrary and does not match bitcoind's.
Get a list of the last 10 transactions to enter the mempool.
Each transaction object contains simplified overview data, with the following fields: txid
, fee
, vsize
and value
Get an object where the key is the confirmation target (in number of blocks) and the value is the estimated feerate (in sat/vB).
The available confirmation targets are 1-25, 144, 504 and 1008 blocks.
For example: { "1": 87.882, "2": 87.882, "3": 87.882, "4": 87.882, "5": 81.129, "6": 68.285, ..., "144": 1.027, "504": 1.027, "1008": 1.027 }
Get information about an asset.
For the network's native asset (i.e. L-BTC in Liquid), returns an object with:
asset_id
chain_stats
andmempool_stats
, each with:tx_count
peg_in_count
peg_in_amount
peg_out_amount
peg_out_count
burn_count
burned_amount
For user-issued assets, returns an object with:
asset_id
issuance_txin
: the issuance transaction inputtxid
vin
issuance_prevout
: the previous output spent for the issuancetxid
vout
status
: the confirmation status of the initial asset issuance transactioncontract_hash
: the contract hash committed as the issuance entropyreissuance_token
: the asset id of the reissuance tokenchain_stats
andmempool_stats
, each with:tx_count
: the number of transactions associated with this asset (does not include confidential transactions)issuance_count
: the number of (re)issuance transactionsissued_amount
: the total known amount issued (should be considered a minimum bound whenhas_blinded_issuances
is true)burned_amount
: the total amount provably burnedhas_blinded_issuances
: whether at least one of the (re)issuances were blindreissuance_tokens
: the number of reissuance tokensburned_reissuance_tokens
: the number of reissuance tokens burned
If the asset is available on the registry, the following fields are returned as well:
contract
: the full json contract json committed in the issuanceentity
: the entity linked to this asset. the only available type is currentlydomain
, which is encoded as{ "domain": "foobar.com>" }
(required)ticker
: a 3-5 characters ticker associated with the asset (optional)precision
: the number of decimal places for units of this asset (defaults to 0)name
: a description for the asset (up to 255 characters)
Example native asset:
{
"asset_id": "6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d",
"chain_stats": {"tx_count": 54, "peg_in_count": 2, "peg_in_amount": 1600000000, "peg_out_count": 51, "peg_out_amount": 250490000, "burn_count":0, "burned_amount": 0 },
"mempool_stats": {"tx_count": 3, "peg_in_count": 0, "peg_in_amount": 0, "peg_out_count": 3, "peg_out_amount": 70020000, "burn_count": 0, "burned_amount": 0 }
}
Example user-issued asset:
{
"asset_id": "d8a317ce2c14241192cbb3ebdb9696250ca1251a58ba6251c29fcfe126c9ca1f",
"issuance_txin":{ "txid": "39affca34bd51ed080f89f1e7a5c7a49d6d9e4779c84424ae50df67dd60dcaf7", "vin": 0},
"issuance_prevout": { "txid": "0cdd74c540af637d5a3874ce8500891fd8e94ec8e3d5d436d86e87b6759a7674", "vout": 0 },
"reissuance_token": "eb8b210d42566699796dbf78649120fd5c9d9b04cabc8f480856e04bd5e9fc22",
"contract_hash": "025d983cc774da665f412ccc6ccf51cb017671c2cb0d3c32d10d50ffdf0a57de",
"status": { "confirmed": true, "block_height": 105, "block_hash": "7bf84f2aea30b02981a220943f543a6d6e7ac646d59ef76cff27dca8d27b2b67", "block_time": 1586248729 },
"chain_stats": { "tx_count": 1, "issuance_count": 1, "issued_amount": 0, "burned_amount": 0, "has_blinded_issuances": true, "reissuance_tokens": 0, "burned_reissuance_tokens": 0 },
"mempool_stats": { "tx_count": 0, "issuance_count": 0, "issued_amount": 0, "burned_amount": 0, "has_blinded_issuances": false, "reissuance_tokens": null, "burned_reissuance_tokens": 0 }
}
Get transactions associated with the specified asset.
For the network's native asset, returns a list of peg in, peg out and burn transactions.
For user-issued assets, returns a list of issuance, reissuance and burn transactions.
Does not include regular transactions transferring this asset.
Get the current total supply of the specified asset.
For the native asset (L-BTC), this is calculated as {chain,mempool}_stats.peg_in_amount - {chain,mempool}_stats.peg_out_amount - {chain,mempool}_stats.burned_amount
.
For issued assets, this is calculated as {chain,mempool}_stats.issued_amount - {chain,mempool}_stats.burned_amount
.
Not available for assets with blinded issuances.
If /decimal
is specified, returns the supply as a decimal according to the asset's divisibility.
Otherwise, returned in base units.
Get the list of issued assets in the asset registry.
Query string parameters:
start_index
: the start index to use for paging. defaults to 0.limit
: maximum number of assets to return. defaults to 25, maximum 100.sort_field
: field to sort assets by. one ofname
,ticker
ordomain
. defaults toticker
.sort_dir
: sorting direction. one ofasc
ordesc
. defaults toasc
.
Assets are returned in the same format as in GET /asset/:asset_id
.
The total number of results will be returned as the x-total-results
header.
txid
version
locktime
size
weight
fee
vin[]
txid
vout
is_coinbase
scriptsig
scriptsig_asm
inner_redeemscript_asm
inner_witnessscript_asm
sequence
witness[]
prevout
(previous output in the same format as invout
below)- (Elements only)
is_pegin
issuance
(available for asset issuance transactions,null
otherwise)asset_id
is_reissuance
asset_id
asset_blinding_nonce
asset_entropy
contract_hash
assetamount
orassetamountcommitment
tokenamount
ortokenamountcommitment
vout[]
scriptpubkey
scriptpubkey_asm
scriptpubkey_type
scriptpubkey_address
value
- (Elements only)
valuecommitment
asset
orassetcommitment
pegout
(available for peg-out outputs,null
otherwise)genesis_hash
scriptpubkey
scriptpubkey_asm
scriptpubkey_address
status
confirmed
(boolean)block_height
(available for confirmed transactions,null
otherwise)block_hash
(available for confirmed transactions,null
otherwise)block_time
(available for confirmed transactions,null
otherwise)
id
height
version
timestamp
bits
nonce
difficulty
merkle_root
tx_count
size
weight
previousblockhash
mediantime
(median time-past)- (Elements only)
proof
challenge
challenge_asm
solution
solution_asm