This site has been acquired by Toptal.com.
(Attention! API endpoint has changed)

CSS Minifier

Online CSS Minifier/Compressor. Free! Provides an API. Simple Quick and Fast.

Ruby

Thanks to Jeremy Cron for contributing this example.

require "rest_client"

task :minify do
  css_file = "public/stylesheets/main.css"
  css_min_file = "public/stylesheets/min/main.min.css"
  response = RestClient.post "https://www.toptal.com/developers/cssminifier/raw", {:input => File.open(css_file).read}
  File.open(css_min_file, "w").write(response)
end

Click on the language of your choice to see an example: