Documentation
General
Addresses
Blocks
Mining
Fees
Mempool
Transactions
Lightning
Below is a reference for the Testnet REST API service.
General
GET Difficulty Adjustment general
Description
Returns details about difficulty adjustment.
Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/v1/difficulty-adjustment"
Response
{
progressPercent: 44.397234501112074,
difficultyChange: 98.45932018381687,
estimatedRetargetDate: 1627762478,
remainingBlocks: 1121,
remainingTime: 665977,
previousRetarget: -4.807005268478962,
nextRetargetHeight: 741888,
timeAvg: 302328,
adjustedTimeAvg: 302328,
timeOffset: 0
}
Addresses
GET Address addresses
Description
Returns details about an address. Available fields:
address
, chain_stats
, and mempool_stats
. chain_stats
and mempool_stats
each contain an object with tx_count
, funded_txo_count
, funded_txo_sum
, spent_txo_count
, and spent_txo_sum
.Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/address/tb1qp0we5epypgj4acd2c4au58045ruud2pd6heuee"
Response
{
address: "tb1qp0we5epypgj4acd2c4au58045ruud2pd6heuee",
chain_stats: {
funded_txo_count: 6747,
funded_txo_sum: 84313783821,
spent_txo_count: 0,
spent_txo_sum: 0,
tx_count: 6747
},
mempool_stats: {
funded_txo_count: 0,
funded_txo_sum: 0,
spent_txo_count: 0,
spent_txo_sum: 0,
tx_count: 0
}
}
GET Address Transactions addresses
Description
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 an
after_txid
query parameter.Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/address/tb1qp0we5epypgj4acd2c4au58045ruud2pd6heuee/txs"
Response
[
{
txid: "3e6afd67862ce9fe3eb55268a3107f495415ff1b5d1933c928507e9bdf7a21e6",
version: 2,
locktime: 0,
vin: [],
vout: [],
size: 211,
weight: 736,
fee: 0,
status: {
confirmed: true,
block_height: 2091086,
block_hash: "00000000340f3667cce7032d084973ca29bdd0d858ec363ed894ad4c8ed09ebc",
block_time: 1630607773
}
},
...
]
GET Address Transactions Chain addresses
Description
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.
Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/address/tb1qp0we5epypgj4acd2c4au58045ruud2pd6heuee/txs/chain"
Response
[
{
txid: "3e6afd67862ce9fe3eb55268a3107f495415ff1b5d1933c928507e9bdf7a21e6",
version: 2,
locktime: 0,
vin: [],
vout: [],
size: 211,
weight: 736,
fee: 0,
status: {
confirmed: true,
block_height: 2091086,
block_hash: "00000000340f3667cce7032d084973ca29bdd0d858ec363ed894ad4c8ed09ebc",
block_time: 1630607773
}
},
...
],
GET Address Transactions Mempool addresses
Description
Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging).
Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/address/tb1qp0we5epypgj4acd2c4au58045ruud2pd6heuee/txs/mempool"
Response
[
{
txid: "16cd9bbc6b62313a22d16671fa559aec6bf581df8b5853d37775c84b0fddfa90",
version: 2,
locktime: 0,
vin: [ [Object] ],
vout: [ [Object], [Object] ],
size: 226,
weight: 904,
fee: 6720,
status: { confirmed: false }
}
]
GET Address UTXO addresses
Description
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).Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/address/tb1q4kgratttzjvkxfmgd95z54qcq7y6hekdm3w56u/utxo"
Response
[
{
txid: "c404bc4ba89e9423ff772cb45268ba6fba8b713f809484c1216f1a657aafa088",
vout: 1,
status: {
confirmed: true,
block_height: 2086944,
block_hash: "000000000000039a27007892b0f3ac646afa4eb3ef3d4a4e75e8bdf636b4d006",
block_time: 1630159123
},
value: 1973787
},
...
]
GET Address Validation addresses
Description
Returns whether an address is valid or not. Available fields:
isvalid
(boolean), address
(string), scriptPubKey
(string), isscript
(boolean), iswitness
(boolean), witness_version
(numeric, optional), and witness_program
(string, optional).Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/v1/validate-address/tb1q4kgratttzjvkxfmgd95z54qcq7y6hekdm3w56u"
Response
{
isvalid: true,
address: "tb1q4kgratttzjvkxfmgd95z54qcq7y6hekdm3w56u",
scriptPubKey: "0014ad903ead6b149963276869682a54180789abe6cd",
isscript: false,
iswitness: true,
witness_version: 0,
witness_program: "ad903ead6b149963276869682a54180789abe6cd"
}
Blocks
GET Block blocks
Endpoint
GET /testnet/api/block/:hashDescription
Returns details about a block.
Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/block/000000000000009c08dc77c3f224d9f5bbe335a78b996ec1e0701e065537ca81"
Response
{
id: "000000000000009c08dc77c3f224d9f5bbe335a78b996ec1e0701e065537ca81",
height: 2091140,
version: 543162372,
timestamp: 1630625150,
tx_count: 2,
size: 575,
weight: 1865,
merkle_root: "5d10d8d158bb8eb217d01fecc435bd10eda028043a913dc2bfe0ccf536a51cc9",
previousblockhash: "0000000000000073f95d1fc0a93d449f82a754410c635e46264ec6c7c4d5741e",
mediantime: 1630621997,
nonce: 1600805744,
bits: 436273151,
difficulty: 16777216
}
GET Block Header blocks
Description
Returns the hex-encoded block header.
Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/block/000000000000009c08dc77c3f224d9f5bbe335a78b996ec1e0701e065537ca81/header"
Response
040060201e74d5c4c7c64e26465e630c4154a7829f443da9c01f5df97300000000000000c91ca536f5cce0bfc23d913a0428a0ed10bd35c4ec1fd017b28ebb58d1d8105d7e5d3161ffff001a705b6a5f
GET Block Height blocks
Description
Returns the hash of the block currently at
:height
.GET Block Timestamp blocks
Description
Returns the height and the hash of the block closest to the given
:timestamp
.Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/v1/mining/blocks/timestamp/1672531200"
Response
{
height: 2413838,
hash: "00000000000000082888e2353ea4baaea04d2e0e88f2ee054ad2bbcc1d6a5469",
timestamp: "2022-12-31T23:57:26.000Z"
}
GET Block Raw blocks
GET Block Status blocks
Description
Returns the confirmation status of a block. 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).GET Block Tip Height blocks
Description
Returns the height of the last block.
GET Block Tip Hash blocks
GET Block Transaction ID blocks
Description
Returns the transaction at index
:index
within the specified block.GET Block Transaction IDs blocks
Description
Returns a list of all txids in the block.
Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/block/000000000000004a3ff1faff12c446f711c650454ff8af7f41d1e8b2564dd74b/txids"
Response
[
"b5d033f57045b76f2f29df0c2469be0153ecf2514717bccd8d52250b3e7ba781",
"7aede67cd9f48c2f77ca9112c27da2583ea41fbb391652777c44ef21d5b1656e",
"20827f9a8fb5ec5fa55ce5389b1d7520d7961272492dc3424874887daeea21dc"
]
GET Block Transactions blocks
Description
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.Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/block/000000000000004a3ff1faff12c446f711c650454ff8af7f41d1e8b2564dd74b/txs"
Response
[
{
txid: "b5d033f57045b76f2f29df0c2469be0153ecf2514717bccd8d52250b3e7ba781",
version: 2,
locktime: 0,
vin: [],
vout: [],
size: 238,
weight: 844,
fee: 0,
status: {
confirmed: true,
block_height: 2091173,
block_hash: "000000000000004a3ff1faff12c446f711c650454ff8af7f41d1e8b2564dd74b",
block_time: 1630635771
}
},
...
],
GET Blocks blocks
Description
Returns details on the past 15 blocks with fee and mining details in an
extras
field. If :startHeight
is specified, the past 15 blocks before (and including) :startHeight
are returned.Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/v1/blocks/2091187"
Response
[
{
"id": "00000000000000533f63df886281a9fd74da163e84a21445153ff480e5f57970",
"timestamp": 1630641890,
"height": 2091187,
"version": 545259520,
"bits": 436273151,
"nonce": 309403673,
"difficulty": 16777216,
"merkle_root": "4d6df12a4af11bb928c7b2930e0a4d2c3e268c6dc6a07462943ad1c4b6b96468",
"tx_count": 26,
"size": 8390,
"weight": 22985,
"previousblockhash": "0000000000000079103da7d296e1480295df795b7379e7dffd27743e214b0b32",
"extras": {
"coinbaseRaw": "03b3e81f3a205468697320626c6f636b20776173206d696e65642077697468206120636172626f6e206e6567617469766520706f77657220736f75726365201209687a2009092009020de601d7986a040000",
"medianFee": 1,
"feeRange": [
1,
1,
1,
1,
5,
56,
5053
],
"reward": 10547567,
"totalFees": 781942,
"avgFee": 31277,
"avgFeeRate": 143,
"pool": {
"id": 137,
"name": "Unknown",
"slug": "unknown"
}
}
},
...
]
GET Blocks (Bulk) blocks
Description
Returns details on the range of blocks between :minHeight
and :maxHeight
, inclusive, up to 10 blocks. If :maxHeight
is not specified, it defaults to the current tip.
To return data for more than 10 blocks, consider becoming an enterprise sponsor.
Code Example
curl -sSL "https://mempool.emzy.de/testnet/api/v1/blocks-bulk/100000/100000"
Response