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

JavaScript Minifier

Online JavaScript Minifier/Compressor. Provides an API. Simple and Fast.


    // setup the URL and read the JS from a file
    $url = '';
    $js = file_get_contents('ready.js');

    // init the request, set various options, and send it
    $ch = curl_init();

    curl_setopt_array($ch, [
        CURLOPT_URL => $url,
        CURLOPT_POST => true,
        CURLOPT_HTTPHEADER => ["Content-Type: application/x-www-form-urlencoded"],
        CURLOPT_POSTFIELDS => http_build_query([ "input" => $js ])

    $minified = curl_exec($ch);

    // finally, close the request

    // output the $minified JavaScript
    echo $minified;

Also, Toni Almeida has made a PHP library to easily talk to JavaScript Minifier :

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