Skip to content

API

Image conversion over HTTP

Overview

The Convert2WebP API lets you convert images between formats programmatically. Send a multipart request with your image and receive the converted file in the response body. All processing happens server-side with sub-second latency for most files.

Base URL

https://convert2webp.com/api/v1

Authentication

No authentication is required. The API is free and open. All requests are rate-limited to 60 requests per minute per IP address.

Rate limiting

Rate limits are applied per IP address. All responses include rate limit headers.

LimitMax File SizeMax Batch Files
60 requests / minute10 MB per file20 files per batch

Rate limit headers are included in every response: X-RateLimit-Remaining, X-RateLimit-Reset.

Endpoints

Convert a single image to a target format. Accepts multipart/form-data with the image file and optional parameters.

Parameters

NameTypeRequiredDescription
fileFileRequiredThe image file to convert. Accepts PNG, JPG, GIF, BMP, TIFF, SVG, AVIF, ICO, and WebP.
output_formatstringOptionalTarget output format: webp, png, jpg, gif, bmp, or pdf.(default: webp)
qualityintegerOptionalOutput quality from 1 (lowest) to 100 (highest).(default: 80)
widthintegerOptionalMax output width in pixels. Aspect ratio is preserved.
heightintegerOptionalMax output height in pixels. Aspect ratio is preserved.
strip_metadatabooleanOptionalStrip EXIF/IPTC/XMP metadata from the output.(default: true)

Responses

200
Converted image binaryimage/webp
400
Invalid request (missing file, unsupported format, etc.)application/json
413
File too largeapplication/json
429
Rate limit exceededapplication/json
500
Internal server errorapplication/json

Code examples

terminal
curl -X POST https://convert2webp.com/api/v1/convert \
  -F "file=@photo.png" \
  -F "format=webp" \
  -F "quality=80" \
  -o converted.webp

Try it

No file selected

Convert multiple images in a single request. Returns a ZIP archive with all converted files.

Parameters

NameTypeRequiredDescription
filesFile[]RequiredArray of image files to convert. Maximum 20 files per request.
formatstringOptionalTarget output format applied to all files.(default: webp)
qualityintegerOptionalOutput quality from 1 to 100.(default: 80)

Responses

200
ZIP archive containing all converted imagesapplication/zip
400
Invalid requestapplication/json
413
Total payload too largeapplication/json
429
Rate limit exceededapplication/json

Code examples

terminal
curl -X POST https://convert2webp.com/api/v1/batch \
  -F "files=@image1.png" \
  -F "files=@image2.jpg" \
  -F "files=@image3.gif" \
  -F "format=webp" \
  -F "quality=80" \
  -o converted.zip

List all supported input and output image formats.

Responses

200
JSON object listing supported input and output formatsapplication/json

Code examples

terminal
curl https://convert2webp.com/api/v1/formats

Example Response

response.json
{
  "input": [
    "png", "jpg", "jpeg", "gif", "bmp",
    "tiff", "svg", "avif", "ico", "webp"
  ],
  "output": ["webp", "png", "jpg", "gif", "bmp", "pdf"]
}

Check service availability.

Responses

200
Service status and versionapplication/json

Code examples

terminal
curl https://convert2webp.com/api/v1/health

Example Response

response.json
{
  "status": "ok",
  "version": "1.0.0",
  "timestamp": "2026-04-04T12:00:00.000Z"
}

Error codes

All error responses return a JSON body with an error object describing what went wrong.

error-response.json
{
  "error": {
    "code": 429,
    "message": "Rate limit exceeded. Please wait 30 seconds before retrying."
  }
}
CodeNameDescription
400Bad RequestThe request was malformed. Check that all required parameters are present and valid.
413Payload Too LargeThe uploaded file exceeds the 10 MB limit.
415Unsupported Media TypeThe uploaded file format is not supported for conversion.
429Too Many RequestsYou have exceeded the rate limit (60 requests per minute). Wait and retry.
500Internal Server ErrorAn unexpected error occurred. If this persists, contact convert2webp@deployvision.com.