REST API • Free Unlimited Compressions

The image optimization
API built for developers

Compress and optimize images in real time using a simple developer-friendly API. Convert images to WebP and AVIF for faster websites and better performance.

Why it matters

Why compress your images?

Image optimization is the single highest-impact web performance change most websites can make.

Dramatically faster loads

Smaller images mean less data. Pages load faster, bounce rates drop, users stay longer.

Better SEO rankings

Google uses Core Web Vitals as a ranking signal. Faster LCP directly impacts your position.

Reduced bandwidth costs

Serve 80% less data for every image. Directly reduces your CDN and hosting bills.

Better mobile experience

Mobile users on slow connections benefit most. Smaller images load faster on 3G/4G.

Zero visible quality loss

Our smart algorithm finds the optimal compression level per image, invisible to the eye.

Effortless automation

WordPress plugin to REST API — integrate optimization into your workflow once and forget.

API Reference

Simple, powerful, flexible

One API endpoint handles compression, conversion, resizing, and cropping. Official SDKs available for all major languages.

<?php $ch = curl_init('https://api.speedimgs.com/api/optimize'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_API_KEY']); curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'image' => new CURLFile('/path/to/image.png'), 'format' => 'webp,avif,jpeg,svg,png,jxl', ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response;
import requests url = "https://api.speedimgs.com/api/optimize" headers = {"Authorization": "Bearer YOUR_API_KEY"} files = {"image": open("image.png", "rb")} data = {"format": "webp,avif,jpeg,svg,png,jxl"} response = requests.post(url, headers=headers, files=files, data=data) print(response.json())
curl -X POST \ https://api.speedimgs.com/api/optimize \ -H 'Authorization: Bearer YOUR_API_KEY' \ -F 'image=@/path/to/image.png' \ -F 'format=webp,avif,jpeg,svg,png,jxl'
const fs = require('fs'); const form = new FormData(); form.append('image', new Blob([fs.readFileSync('image.png')]), 'image.png'); form.append('format', 'webp,avif,jpeg,svg,png,jxl'); const response = await fetch('https://api.speedimgs.com/api/optimize', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY' }, body: form, }); console.log(await response.json());
API Endpoints

Everything you need

POST
/api/analyze
Analyze website speed, performance, SEO, and Core Web Vitals in real time.
POST
/api/optimize
Convert to AVIF, WebP, PNG, JPEG,SVG or JXL
GET
/api/balance
Check your current API credit balance and monitor remaining usage in real time.
Integrations

Works with your tools

Build your own

Need a custom integration?

SpeedImgs has a comprehensive REST API with official SDKs for Node.js, Python, PHP, Ruby, Go, and Java. Build any integration you need — we have docs, examples, and a dedicated developer support channel.

View API docs
START FOR JUST $1.5/MONTH

Fast & Unlimited Image
Compression API

Reduce image sizes instantly and boost performance with lightning-fast compression, unlimited API requests, and better SEO results.