Find answers, guides, and tutorials to optimize your images.

Image Compression API

Updated on February 2, 2019
Image Compression API

Optimus can be used for more than just WordPress! Optimus provides an easy developer API to automatically compress and optimize your images. This allows to integrate Optimus directly into your image optimization process of your application. You can use your existing license key to make use of the image compression API. Don't have a license yet? Buy a license here.

Direct curl requests

Optimize and compress your image:

curl --data-binary @image.jpg -o optimized.jpg -H 'user-agent: Optimus-API' -H 'accept: image/*' https://api.optimus.io/<your_license_key>?optimize

Optimize and compress your image but keep the metadata:

curl --data-binary @image.jpg -o optimized.jpg -H 'user-agent: Optimus-API' -H 'accept: image/*' https://api.optimus.io/<your_license_key>?clean

Optimize and convert your image to WebP:

curl --data-binary @image.jpg -o optimized.jpg -H 'user-agent: Optimus-API' -H 'accept: image/*' https://api.optimus.io/<your_license_key>?webp

Image compression API libraries

Use any of the following API libraries to integrate Optimus directly into your web project:

We did not complete all the libraries for all the different programming languages for the Optimus API. Please contribute to the adapters to make the image compression simpler for everyone.

API requests are rate limited at 5 requests per second. Please remain within this number of requests/second otherwise the Optimus API will return an HTTP 429 "Too Many Requests" response code when you exceed the rate limit.

KeyCDN uses cookies to make its website easier to use. Learn more about cookies.