The best image compressor

Download everything

HTTP API Request

To integrate the NitroSmush service into your website, do a POST request as described below:

Content-Length: {content_length}
Content-Type: multipart/form-data; boundary=----{boundary}

Content-Disposition: form-data; name="quality"

Content-Disposition: form-data; name="image"; filename="{file_name.ext}"
Content-Type: {content_type}


The allowed values for {content_type} are: image/jpeg, image/png, image/gif

{quality} must be a numeric value between 1 and 100. If you pass 100 you will enable lossless compression. Any other value between 1 and 99 will enable lossy compression.

HTTP API Response

The response is a JSON string with the following data:

    result_file: "",
    savings_b: savings_in_bytes,
    savings_percent: savings_in_percent

If an error occurs, the response looks like this:

    error: "Long error message, which can be sent to us for inspection.",
    error_short: "Short error message, which you can show to your users."