rest/mempool/contents - Bitcoin
This endpoint returns every transaction in the node's memory pool, keyed by transaction id, with fee, size, and ancestry detail for each.
Parameters
This endpoint takes no parameters.
Request
bashcurl --location --request GET 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/rest/mempool/contents.json'example.js
javascriptconst response = await fetch(
'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/rest/mempool/contents.json'
);
console.log(await response.json());example.py
pythonimport requests
response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/rest/mempool/contents.json')
print(response.json())Response
json{
"ceb5a478b0a44835626fa450b345da2ea238023429da02069d001332b713c720": {
"vsize": 141,
"weight": 561,
"time": 1789899404,
"height": 967816,
"descendantcount": 1,
"descendantsize": 141,
"ancestorcount": 1,
"ancestorsize": 141,
"wtxid": "73f3430babb5c56e0d7aebf85e72a18118305b89ae22e94cee5f62d5618b601b",
"chunkweight": 561,
"fees": {
"base": 0.0001974,
"modified": 0.0001974,
"ancestor": 0.0001974,
"descendant": 0.0001974,
"chunk": 0.0001974
},
"depends": [],
"spentby": [],
"bip125-replaceable": true,
"unbroadcast": false
}
}The response is an object keyed by txid; one entry is shown.
Response Parameters
| Field | Type | Description |
|---|---|---|
| vsize | numeric | Virtual size in vbytes |
| weight | numeric | Transaction weight |
| time | numeric | Unix time the transaction entered the mempool |
| height | numeric | Chain height when the transaction entered the mempool |
| descendantcount | numeric | In-mempool descendants, including this transaction |
| ancestorcount | numeric | In-mempool ancestors, including this transaction |
| wtxid | string | Witness transaction id |
| fees | object | Fees in BTC: base, modified, and the ancestor, descendant, and chunk aggregates |
| depends | array | Transaction ids of unconfirmed parents |
| spentby | array | Transaction ids of unconfirmed children |
| bip125-replaceable | boolean | True when the transaction may be replaced under RBF |
This response is very large. The mempool held 22,536 transactions when the example was captured, and the full response measured 12.7 MB. Requesting it on a timer will dominate your bandwidth and the node's response time.
Use rest/mempool/info when you only need counts and fee floors, and request contents sparingly.
Use Cases
- Fee Estimation: Build your own estimate from the fee rates currently queued
- Pending Detection: Find whether a specific transaction is still waiting
- Ancestry Analysis: Read
dependsandspentbyto map unconfirmed chains
Error Handling
| HTTP Status | Message | Description |
|---|---|---|
| 400 | Bad request | The path is malformed, or a hash or height is invalid |
| 403 | Forbidden | Missing or invalid ACCESS-TOKEN |
| 404 | Not found | No object matches the requested hash, height, or outpoint |
| 500 | Internal error | The node failed to process the request |