You can get "fee quotes" from miners (IE: https://developers.whatsonchain.com/#fee-quotes)
However, after getting the quote, you would need to generate the tx and then do the fee calculations.
Minercraft is a package intended to help with those requests.
In JS - there is: https://github.com/interplanaria/minercraft
In Go - there is: https://github.com/tonicpow/go-minercraft