Bitfinex get Trading Fees via API
Here is the endpoint where trade fees along with order_id and fee_currency are included https://api.bitfinex.com/v1/mytrades

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
    )
)


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 &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.