Convert Image to WebP

This endpoint allows you to convert existing images (PNG, JPG, JPEG) into the highly optimized WebP format. This reduces file size significantly while maintaining quality, making your application faster.

Endpoint

POST https://api.zapifyapi.com/v1/{api_token}

Path Parameters

Parameter Type Description
api_token string Required. Your unique API access token.

Request Body

The request expects a JSON object.

Key Type Description
binaryData string Required. The Base64 encoded string of the source image (PNG or JPG).

Example Request

cURL

curl -X POST "https://api.zapifyapi.com/v1/YOUR_API_TOKEN" 
     -H "Content-Type: application/json" 
     -d '{
           "binaryData": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
         }'

Response

The API returns the converted WebP image data.

{
  "success": true,
  "format": "webp",
  "binaryData": "UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA..."
}