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

FieldTypeDescription
vsizenumericVirtual size in vbytes
weightnumericTransaction weight
timenumericUnix time the transaction entered the mempool
heightnumericChain height when the transaction entered the mempool
descendantcountnumericIn-mempool descendants, including this transaction
ancestorcountnumericIn-mempool ancestors, including this transaction
wtxidstringWitness transaction id
feesobjectFees in BTC: base, modified, and the ancestor, descendant, and chunk aggregates
dependsarrayTransaction ids of unconfirmed parents
spentbyarrayTransaction ids of unconfirmed children
bip125-replaceablebooleanTrue 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 depends and spentby to map unconfirmed chains

Error Handling

HTTP StatusMessageDescription
400Bad requestThe path is malformed, or a hash or height is invalid
403ForbiddenMissing or invalid ACCESS-TOKEN
404Not foundNo object matches the requested hash, height, or outpoint
500Internal errorThe node failed to process the request