<p>Have you tried using the <code>estimatefee</code> <a href="https://bitcoin.org/en/developer-reference#estimatefee" rel="noreferrer">RPC call</a>? This will calculate the amount needed per kilobyte. </p>

<p>For example calling <code>bitcoin-cli estimatefee 2</code> would provide a fee per kb to try to get confirmed within 2 blocks. </p>

<p><a href="https://bitcoin.org/en/developer-reference#estimatefee" rel="noreferrer">https://bitcoin.org/en/developer-reference#estimatefee</a></p>

CC BY-SA 3.0
2016-12-27T10:59:30.863Z
In fact, if you use any of the automatic send RPCs (`sendtoaddress` etc), and don't configure a manual feerate (the `-paytxfee` option), fee estimation will be used automatically.
Pieter Wuille
CC BY-SA 3.0
2016-12-27T04:16:00.823Z
2016-12-27T04:16:00.823Z
m1xolyd1an
<p>I am using <a href="https://bitcoinfees.net" rel="nofollow noreferrer">https://bitcoinfees.net</a> . They hare using Bitcoin Core's "estimatesmartfee" method. You can easily pick a transaction fee based on confirmation time.</p>

CC BY-SA 4.0
2018-11-27T10:18:05.460Z
2018-11-27T10:18:05.460Z
Васил Тошков
<p>The other answer is outdated. <code>estimatefee</code> is deprecated.
You should use <code>estimatesmartfee</code></p>

<blockquote>
  <p>Please use estimatesmartfee for more intelligent estimates.
  Estimates the approximate fee per kilobyte needed for a transaction to begin
  confirmation within nblocks blocks. Uses virtual transaction size of transaction
  as defined in BIP 141 (witness data is discounted).</p>
  
  <p>Arguments:
  1. nblocks     (numeric, required)</p>
</blockquote>

<p><strong>Example:</strong></p>

<pre><code>bitcoin-cli estimatesmartfee 6
</code></pre>

CC BY-SA 3.0
2018-01-23T10:55:00.987Z
2018-01-24T22:03:27.267Z
2018-01-24T22:03:27.267Z
Aminadav Glickshtein
<p>As I understand, with the network congestion it's sometimes advisable to set a higher fee to process a transaction within a block or two. Is there some way to estimate the optimal fee through calls to bitcoind? I know there are <a href="https://estimatefee.appspot.com/" rel="noreferrer">some online services</a> that do those estimations, but I'd rather not rely on such external factors.</p>

<bitcoind><api><transaction-fees>
How to estimate optimal fees for transaction in bitcoind?
ThePiachu
# How to estimate optimal fees for transaction in bitcoind?

(Asked by: username_0 on 2016-12-26)

As I understand, with the network congestion it's sometimes advisable to set a higher fee to process a transaction within a block or two. Is there some way to estimate the optimal fee through calls to bitcoind? I know there are [some online services](https://estimatefee.appspot.com/) that do those estimations, but I'd rather not rely on such external factors.

**Tags:** bitcoind, api, transaction-fees


---

## 3 answers

### Answer by username_4 on 2018-01-23. Score: 11 | Accepted answer

The other answer is outdated. `estimatefee` is deprecated.
You should use `estimatesmartfee`

> Please use estimatesmartfee for more intelligent estimates.
> Estimates the approximate fee per kilobyte needed for a transaction to begin
> confirmation within nblocks blocks. Uses virtual transaction size of transaction
> as defined in BIP 141 (witness data is discounted).
>
> Arguments:
> 1. nblocks (numeric, required)

**Example:**

```
bitcoin-cli estimatesmartfee 6

```


---

### Answer by username_1 on 2016-12-27. Score: 8

Have you tried using the `estimatefee` [RPC call](https://bitcoin.org/en/developer-reference#estimatefee)? This will calculate the amount needed per kilobyte.

For example calling `bitcoin-cli estimatefee 2` would provide a fee per kb to try to get confirmed within 2 blocks.

<https://bitcoin.org/en/developer-reference#estimatefee>

> **Comments:**
> **username_2**: In fact, if you use any of the automatic send RPCs (`sendtoaddress` etc), and don't configure a manual feerate (the `-paytxfee` option), fee estimation will be used automatically.  

---

### Answer by username_3 on 2018-11-27. Score: 1

I am using <https://bitcoinfees.net> . They hare using Bitcoin Core's "estimatesmartfee" method. You can easily pick a transaction fee based on confirmation time.


---

