at Transmate we regularly need to calculate co2 emissions per shipment. CO2 is a multiplication of distance, CO2 emission per transport type and weight.
We use this during the freight tendering as one of the decision factors!
For road distance we can use our OSRM routing server. For air a straight line calculation will give us a good estimate.
However for sea shipments calculating the distance was not easy until now...
We have build an api and it is open for you to try and explore. Let us know if it would help you in your business.
You can use the tool on this Ocean-Distance-Calculator page
or try the API directly (try other ports like Hamburg, Amsterdam,Antwerp,Hong Kong ...)
Contact us if you would like to run this API in production or if you would like to use UNLOCODE, or coordinates instead of the port names.