estimateFee - Bitcoin

Returns the backend fee estimate for one or more confirmation targets. Supplying the transaction's virtual size returns the estimated total fee for a transaction of that size, alongside the per-unit rate. This is the WebSocket form of the REST api/v2/estimatefee endpoint.

Parameters

ParameterTypeRequiredDescription
blocksarrayYesConfirmation targets in blocks, one estimate returned per entry
specificobjectNoChain-specific options: conservative for smart fee mode, txsize in vbytes

Message

bashwscat -c wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>

# then send:
{
    "id": "getblock.io",
    "method": "estimateFee",
    "params": {
        "blocks": [1, 6, 24],
        "specific": {
            "conservative": true,
            "txsize": 144
        }
    }
}

Response

json{
    "id": "getblock.io",
    "data": [
        {
            "feePerTx": "171",
            "feePerUnit": "1190"
        },
        {
            "feePerTx": "74",
            "feePerUnit": "511"
        },
        {
            "feePerTx": "40",
            "feePerUnit": "278"
        }
    ]
}

Response Fields

FieldTypeDescription
feePerTxstringEstimated total fee in satoshis for a transaction of the supplied txsize
feePerUnitstringEstimated fee rate in satoshis per kilobyte, not per vbyte

Results are returned in the same order as the requested blocks targets.

feePerUnit is quoted per 1000 bytes, following the backend's estimatesmartfee, which reports BTC per kilobyte. Dividing by 1000 gives the sat/vB rate wallets usually display: the 1190 above is 1.19 sat/vB, not 1190. Treating it as sat/vB overpays by three orders of magnitude.

feePerTx is derived as txsize × feePerUnit / 1000. In the response above, 144 × 1190 / 1000 = 171.

Use Cases

  • Fee Selection: Choose a rate matching the confirmation speed a payment needs
  • Cost Preview: Show the user the fee before signing
  • Tiered Options: Offer fast, standard, and economy targets from one call
  • Batch Planning: Size a consolidation against the current rate

feePerTx is only meaningful when txsize is supplied. Without it, size the fee as vsize × feePerUnit / 1000, keeping the per-kilobyte denominator in mind.

Error Handling

ErrorMessageDescription
errorInvalid paramsThe blocks array is missing or malformed
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect