<p>Here is the endpoint where trade fees along with order_id and fee_currency are included <code>https://api.bitfinex.com/v1/mytrades</code></p>

<pre><code>Array
(
[0] =&gt; Array
    (
        [price] =&gt; 0.53018
        [amount] =&gt; 20.0
        [timestamp] =&gt; 1539786993.0
        [type] =&gt; Sell
        [fee_currency] =&gt; USD
        [fee_amount] =&gt; -0.0212072
        [tid] =&gt; 301116948
        [order_id] =&gt; 18151111432
    )

[1] =&gt; Array
    (
        [price] =&gt; 0.5317
        [amount] =&gt; 20.0
        [timestamp] =&gt; 1539786941.0
        [type] =&gt; Buy
        [fee_currency] =&gt; IOT
        [fee_amount] =&gt; -0.04
        [tid] =&gt; 301116560
        [order_id] =&gt; 1815111391
    )
)
</code></pre>

<p>This endpoint can also accept <code>limit_trades</code> parameter to limit the number of results returned. Then use <code>foreach</code> loop to get to the required order_id &amp; retrieve the trade fee. Not sure why bitfinex has chosen to make it complicated, this information should be included with the "order status" endpoint.</p>

CC BY-SA 4.0
2018-10-18T16:57:04.097Z
2018-10-18T16:57:04.097Z
Jsp
<p>After placing a market order, I got its order_id &amp; checked its status via this end point <code>/v1/order/status</code> and I got the following:</p>

<pre><code>Array
(
[id] =&gt; 18141116927
[cid] =&gt; 43611135723
[cid_date] =&gt; 2018-10-17
[gid] =&gt; 
[symbol] =&gt; iotusd
[exchange] =&gt; bitfinex
[price] =&gt; 0.51251
[avg_execution_price] =&gt; 0.51234
[side] =&gt; sell
[type] =&gt; market
[timestamp] =&gt; 1539778090.0
[is_live] =&gt; 
[is_cancelled] =&gt; 
[is_hidden] =&gt; 
[oco_order] =&gt; 
[was_forced] =&gt; 
[original_amount] =&gt; 20.0
[remaining_amount] =&gt; 0.0
[executed_amount] =&gt; 20.0
[src] =&gt; api
)
</code></pre>

<p>In this array, I don't see exchange fees for this order. Also the above order is closing a margin position and I was expecting to see fees associated to margin like borrowing costs etc.</p>

<p>How do I get these information via API?</p>

<p>Thanks</p>

<api><bitfinex>
Bitfinex get Trading Fees via API
Jsp
# Bitfinex get Trading Fees via API

(Asked by: username_0 on 2018-10-17)

After placing a market order, I got its order\_id & checked its status via this end point `/v1/order/status` and I got the following:

```
Array
(
[id] => 18141116927
[cid] => 43611135723
[cid_date] => 2018-10-17
[gid] => 
[symbol] => iotusd
[exchange] => bitfinex
[price] => 0.51251
[avg_execution_price] => 0.51234
[side] => sell
[type] => market
[timestamp] => 1539778090.0
[is_live] => 
[is_cancelled] => 
[is_hidden] => 
[oco_order] => 
[was_forced] => 
[original_amount] => 20.0
[remaining_amount] => 0.0
[executed_amount] => 20.0
[src] => api
)

```

In this array, I don't see exchange fees for this order. Also the above order is closing a margin position and I was expecting to see fees associated to margin like borrowing costs etc.

How do I get these information via API?

Thanks

**Tags:** api, bitfinex


---

## 1 answers

### Answer by username_0 on 2018-10-18. Score: 0 | Accepted answer

Here is the endpoint where trade fees along with order\_id and fee\_currency are included `https://api.bitfinex.com/v1/mytrades`

```
Array
(
[0] => Array
    (
        [price] => 0.53018
        [amount] => 20.0
        [timestamp] => 1539786993.0
        [type] => Sell
        [fee_currency] => USD
        [fee_amount] => -0.0212072
        [tid] => 301116948
        [order_id] => 18151111432
    )

[1] => Array
    (
        [price] => 0.5317
        [amount] => 20.0
        [timestamp] => 1539786941.0
        [type] => Buy
        [fee_currency] => IOT
        [fee_amount] => -0.04
        [tid] => 301116560
        [order_id] => 1815111391
    )
)

```

This endpoint can also accept `limit_trades` parameter to limit the number of results returned. Then use `foreach` loop to get to the required order\_id & retrieve the trade fee. Not sure why bitfinex has chosen to make it complicated, this information should be included with the "order status" endpoint.


---

