NitroSmush

The best lossless image compressor

Download everything

HTTP API Request

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

POST http://nitrosmush.com/api.php HTTP/1.1
Host: nitrosmush.com
Content-Length: {content_length}
Content-Type: multipart/form-data; boundary=----{boundary}

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

{raw_image_contents}

------{boundary}--

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

HTTP API Response

The response is a JSON string with the following data:

{
    result_file: "http://nitrosmush.com/path_to_image.ext",
    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."
}