JavaScript Minifier has a solid API and can be used from any language as well as our web frontend.
Click on the language of your choice to see an example: