API Usage

Automate your mozjpeg conversions with our endpoints

You can upload your files from any custom application as long as it supports multipart/form-data and has an ability to post requests to the server.
One of the examples would be to use your favorite terminal with curl installed.

Main URL to the endpoint:

  • https://api.mozjpeg.net/convert

So far, there is no limits as the service is quite new and it's not so popular yet.
If you would like to participate in tools / handy script creation, please share with us through Feedback and we will happily post it here.

To upload and convert a single JPG file to WEBP, you can use:
curl -F  "convert=@/path/to/image.jpg" https://api.mozjpeg.net/convert
To upload multiple files: (Max files 10 at once)
curl -F "convert=@path/to/image.jpg" -F "convert=@path/to/image2.png" -F "convert=@path/to/image3.png" https://api.mozjpeg.net/convert
To convert your whole directory: (Please note sleep switch, bursting files to server will return errors)
find path/to/imagesfolder/ -name '*' -type f -exec curl -F "convert=@"{} https://api.mozjpeg.net/convert \; -exec sleep 1 \;

The response is in JSON format, you can parse it accordingly.

About this service


This website was made as a hobby project in need of quick and sraight-forward tool to optimize images.
If you encouter bugs or have feature requests don't hestitate to contact us.