Bitcoin
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Bitcoin
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
estimatesmartfee asks a Bitcoin Core node for the BTC fee rate it expects you will need so a transaction confirms within a target number of blocks. Bitcoin mines a block roughly every ten minutes under Proof-of-Work, and fees are paid in BTC (denominated on the wire as a rate per kilo-virtual-byte), so picking the right fee is the difference between a transaction that confirms in the next block and one that sits in the mempool for hours. The node derives its estimate from how recent transactions at various fee rates actually got mined. Call it with positional parameters against https://bitcoin.therpc.io/YOUR_API_KEY, passing your confirmation target in blocks.
conf_target: 6 for roughly an hour, or conf_target: 1 to aim for the next block.conf_target values (e.g. 1, 6, 144) and presenting each resulting rate to the user.errors array when the node lacks enough recent data to produce an estimate, instead of silently proceeding with a missing fee rate.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | conf_target | number | Sí | Confirmation target in blocks (1–1008). |
| 2 | estimate_mode | string | No | UNSET | ECONOMICAL | CONSERVATIVE; default changed to ECONOMICAL in newer Core. |
| Tipo | Descripción |
|---|---|
| object | feerate (BTC/kvB, present only when estimable), errors[] (optional), blocks (the target actually used). |
| Código | Mensaje | Causa |
|---|---|---|
-8 | Invalid parameter | A parameter is out of range or the wrong shape — check verbosity levels, conf_target bounds, and required fields. |
feerate is in BTC per kilo-virtual-byte (BTC/kvB), not sat/vB. To convert to the sat/vB figure most wallets display, multiply by 100,000 (1e5) — for example 0.00001500 BTC/kvB equals 1.5 sat/vB.errors array and omits feerate entirely. Do not assume feerate is always present; check for it before using the value.conf_target must be an integer in the range 1–1008 blocks. Values outside that range are rejected with an invalid-parameter error.