Free WebP Converter API — Convert PNG & JPEG to WebP Programmatically
A free REST API to convert PNG and JPEG images to WebP in build scripts, CI pipelines, and backend services. Supports batch conversion, quality control, and base64 output. TypeScript and Python examples included.
If you’ve ever needed to automate image conversion as part of a build pipeline, a backend upload handler, or a CI workflow, you’ve probably hit the same wall: most WebP conversion tools are either desktop apps, browser tools, or native libraries that require installing libvips or ImageMagick on the server.
The SceneSKU WebP Converter API is a free REST endpoint that converts PNG and JPEG images to WebP over HTTP — no native library installation, no setup beyond an API key, and no frontend required.
curl -X POST https://scenesku.com/api/v1/convert \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "images[][email protected]" \
| jq '.data.files[0].data' | base64 -d > product.webp
What it does
Send one or more PNG or JPEG files as multipart/form-data. Get back a JSON response with base64-encoded WebP binaries — one per input file. Decode and save directly. No intermediate storage, no polling, no webhooks.
{
"data": {
"converted": 2,
"failed": 0,
"files": [
{ "filename": "product.webp", "data": "<base64 WebP>" },
{ "filename": "banner.webp", "data": "<base64 WebP>" }
],
"failures": []
}
}
The response includes both a success count and a failures array, so batch jobs can handle partial failures gracefully without crashing the whole pipeline.
Quality control
The API accepts a quality parameter (1–100, default 80). Lower quality means smaller files; higher means better fidelity. For most ecommerce product images, 80 is the right default — visually indistinguishable from the original at roughly half the file size of an equivalent JPEG.
curl -X POST https://scenesku.com/api/v1/convert \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "images[][email protected]" \
-F "quality=90"
| Quality | Best For |
|---|---|
| 60–70 | Thumbnails, background images |
| 75–85 | Product listings, category grids |
| 85–90 | Hero images, featured products |
| 95+ | Near-lossless, source archival |
Free limits
| Limit | Value |
|---|---|
| Files per request | 20 |
| Max file size | 10 MB |
| Rate limit | 100 requests/day per IP |
Get a free API key at scenesku.com → Account → API Keys.
TypeScript and Python examples on GitHub
The scenesku-webp-converter-api repo on GitHub includes ready-to-run examples in TypeScript and Python, along with two sample PNG images so you can run the code immediately without providing your own files.
Clone and run in under a minute:
git clone https://github.com/scenesku/scenesku-webp-converter-api.git
cd scenesku-webp-converter-api
TypeScript (Node 18+, no npm install needed):
API_KEY=your_key npx tsx examples/convert.ts \
examples/sample-images/sample-1.png \
examples/sample-images/sample-2.png
Python (requires pip install requests):
pip install requests
API_KEY=your_key python examples/convert.py \
examples/sample-images/sample-1.png \
examples/sample-images/sample-2.png
Both scripts validate the WebP magic bytes in the response, save the converted .webp files to the current directory, and print a summary:
Converting 2 file(s) at quality=80...
✓ sample-1.webp — 45,231 bytes → /your/path/sample-1.webp
✓ sample-2.webp — 38,904 bytes → /your/path/sample-2.webp
Done. 2 file(s) converted.
The convertImages() / convert_images() functions are also importable directly into your own code — they’re not just CLI scripts.
What developers use it for
CI pipelines. Convert image assets to WebP as part of a build step before deploying to a CDN. No native library required on the CI runner — just curl or a standard HTTP client.
Backend upload handlers. When a user uploads a product image, convert it server-side before storing it. Returns the binary synchronously in the same request — no async job queue needed for small batches.
Bulk migration scripts. Convert an existing library of PNG/JPEG product images to WebP in a single script. Process 20 files per request, loop over batches, save output locally or upload to storage.
Demo storefronts and prototypes. Seed a development environment with WebP images from day one. Skip the PageSpeed audit that reveals the problem after launch.
Why REST instead of a native library?
Native libraries like libvips and ImageMagick are powerful, but they add OS-level dependencies that complicate deployment — especially in containerised environments, serverless functions, and CI runners where you want predictable, minimal build contexts.
A REST API has a different trade-off: you take a network round trip, but your deployment has zero native image library dependencies. For batch sizes up to 20 files, the latency is usually negligible compared to the time it takes to transfer the files themselves.
If you’re already running a server with libvips available, use it directly. If you’re not — or if you’re scripting from a context where installing native libraries is impractical — the REST approach is cleaner.
No-code option
If you don’t need programmatic access, the free web tool at scenesku.com/tools/convert does the same thing in a browser — drag and drop up to 20 PNG/JPEG files, set your quality, download a ZIP. No API key required.
Related
- GitHub: scenesku/scenesku-webp-converter-api — TypeScript and Python examples with sample images
- Free PNG to WebP converter (web tool) — browser-based, no API key needed
- Why WebP is the best image format for ecommerce — the case for switching
- SceneSKU Public Packs API — free ecommerce product images and data, no auth required