user2155: Is there a way to calculate transaction fees without having to go through cardano-cli? Maybe something like Blockfrost? or any other API providers? I don't want to run a local node to do that.

user7225: Transaction fees are computed based on two factors: size of the transactions, and required resources (memory and CPU steps).
As Melroy van den Berg mentioned, transaction size increases the fee linearly:
fee_for_size = a * size(tx) + b

Both a and b are specified in protocol paramaters. You can get the latest parameters with Blockfrost using this endpoint:
/epochs/latest/parameters

min_fee_a is the coefficient, while min_fee_b is the constant.
Blockfrost also provides another endpoint for finding the required resources for a given transaction (I don't remember the exact names used in its response, but let's call them memory and steps).
And if you take another look at the protocol parameters, you may notice two other fields: price_mem and price_step. These are, respectively, price increases per memory and cpu steps. Therefore, you can compute your final transaction fee:
fee = fee_for_size + fee_for_execution

where:
fee_for_size      = a * size(tx) + b
fee_for_execution = memory * price_mem + steps * price_step


2155: <p>Is there a way to calculate transaction fees without having to go through cardano-cli? Maybe something like Blockfrost? or any other API providers? I don't want to run a local node to do that.</p>
 7225: <p>Transaction fees are computed based on two factors: size of the transactions, and required resources (memory and CPU steps).</p>
<p><a href="https://cardano.stackexchange.com/a/8844/7225">As Melroy van den Berg mentioned</a>, transaction size increases the fee linearly:</p>
<pre><code>fee_for_size = a * size(tx) + b
</code></pre>
<p>Both <code>a</code> and <code>b</code> are specified in <em>protocol paramaters</em>. You can get the latest parameters with Blockfrost using <a href="https://docs.blockfrost.io/#tag/Cardano-Epochs/paths/%7E1epochs%7E1%7Bnumber%7D%7E1parameters/get" rel="nofollow noreferrer">this endpoint</a>:</p>
<pre><code>/epochs/latest/parameters
</code></pre>
<p><code>min_fee_a</code> is the coefficient, while <code>min_fee_b</code> is the constant.</p>
<p>Blockfrost also provides <a href="https://docs.blockfrost.io/#tag/Cardano-Utilities/paths/%7E1utils%7E1txs%7E1evaluate/post" rel="nofollow noreferrer">another endpoint</a> for finding the required resources for a given transaction (I don't remember the exact names used in its response, but let's call them <code>memory</code> and <code>steps</code>).</p>
<p>And if you <a href="https://docs.blockfrost.io/#tag/Cardano-Epochs/paths/%7E1epochs%7E1%7Bnumber%7D%7E1parameters/get" rel="nofollow noreferrer">take another look at the protocol parameters</a>, you may notice two other fields: <code>price_mem</code> and <code>price_step</code>. These are, respectively, price increases per memory and cpu steps. Therefore, you can compute your final transaction fee:</p>
<pre><code>fee = fee_for_size + fee_for_execution

where:
fee_for_size      = a * size(tx) + b
fee_for_execution = memory * price_mem + steps * price_step
</code></pre>
