{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk Image Converter & Compressor: WebP, AVIF, JPG, PNG, Resize",
    "description": "Convert and compress images in bulk to WebP, AVIF, JPG or PNG. Resize with cover/contain/fit modes, strip EXIF, fix orientation. From URLs, a ZIP, a dataset or key-value store. $1 per 1,000 images (up to 4 MP).",
    "version": "0.1",
    "x-build-id": "nsbSRT72l5b2f6ajd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/plotpointtech~bulk-image-converter-compressor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-plotpointtech-bulk-image-converter-compressor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/plotpointtech~bulk-image-converter-compressor/runs": {
      "post": {
        "operationId": "runs-sync-plotpointtech-bulk-image-converter-compressor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/plotpointtech~bulk-image-converter-compressor/run-sync": {
      "post": {
        "operationId": "run-sync-plotpointtech-bulk-image-converter-compressor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct links to image files (JPEG, PNG, WebP, AVIF, HEIC, GIF, BMP, TIFF, ICO). data:image URLs also work. Leave all inputs empty to convert 5 public-domain sample images.",
            "items": {
              "type": "string"
            }
          },
          "zipFile": {
            "title": "Upload a ZIP of images",
            "type": "string",
            "description": "Upload a .zip with your images (folders are fine). Every image inside is converted."
          },
          "zipUrls": {
            "title": "ZIP file URLs",
            "type": "array",
            "description": "Links to .zip archives of images, e.g. a Dropbox/Google Drive direct-download link or the ZIP from another Apify run.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Apify dataset ID with image URLs",
            "type": "string",
            "description": "Convert every image URL in an Apify dataset, e.g. the output of an image downloader or product scraper. The URL column is detected automatically (downloadUrl, storedFileUrl, imageUrl, image, url, src) unless you set the field below. Pick one of your storages or paste its ID."
          },
          "datasetUrlField": {
            "title": "Dataset URL field",
            "type": "string",
            "description": "Optional: name of the dataset field that holds the image URL."
          },
          "keyValueStoreId": {
            "title": "Apify key-value store ID with images",
            "type": "string",
            "description": "Convert every image file stored in an Apify key-value store (records that are images, or text records holding an image URL). Pick one of your storages or paste its ID."
          },
          "keyValueStorePrefix": {
            "title": "Key prefix filter",
            "type": "string",
            "description": "Optional: only records whose key starts with this text."
          },
          "outputFormat": {
            "title": "Convert to",
            "enum": [
              "webp",
              "avif",
              "jpg",
              "png",
              "original"
            ],
            "type": "string",
            "description": "Output format. WebP is the best all-round choice for websites; AVIF is smaller still but slower to encode; JPG for maximum compatibility; PNG for lossless graphics.",
            "default": "webp"
          },
          "quality": {
            "title": "Quality (1-100, optional)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Compression quality for WebP, AVIF and JPG. Leave empty for the recommended default: 80 for WebP and JPG, 60 for AVIF (AVIF 60 looks about like JPG 80). Ignored for PNG."
          },
          "lossless": {
            "title": "Lossless (WebP/AVIF)",
            "type": "boolean",
            "description": "Encode WebP losslessly (AVIF at maximum quality, 4:4:4). Larger files, pixel-exact output.",
            "default": false
          },
          "effort": {
            "title": "Compression effort (0-6)",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "Higher = smaller files but slower encoding (WebP method, AVIF speed, PNG zlib level). 4 is a good balance; 6 is the slowest and smallest.",
            "default": 4
          },
          "pngColors": {
            "title": "PNG palette colors (0 = full color)",
            "minimum": 0,
            "maximum": 256,
            "type": "integer",
            "description": "For PNG output: reduce to this many colors (e.g. 256 or 128), like TinyPNG. Often 60-80% smaller for graphics and screenshots. 0 keeps full color.",
            "default": 0
          },
          "progressiveJpeg": {
            "title": "Progressive JPG",
            "type": "boolean",
            "description": "Write progressive JPEGs (load gradually in browsers, usually slightly smaller).",
            "default": true
          },
          "width": {
            "title": "Width (px)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Target or maximum width. Leave empty to keep the original width. With only width set, height scales proportionally."
          },
          "height": {
            "title": "Height (px)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Target or maximum height. Leave empty to keep proportional height."
          },
          "fit": {
            "title": "Fit mode",
            "enum": [
              "inside",
              "cover",
              "contain",
              "fill",
              "outside"
            ],
            "type": "string",
            "description": "How to resize when both width and height are set (same modes as sharp/libvips).",
            "default": "inside"
          },
          "position": {
            "title": "Crop / pad position",
            "enum": [
              "center",
              "top",
              "bottom",
              "left",
              "right",
              "top-left",
              "top-right",
              "bottom-left",
              "bottom-right"
            ],
            "type": "string",
            "description": "Where to anchor the image for Cover crops and Contain padding.",
            "default": "center"
          },
          "allowUpscale": {
            "title": "Allow enlarging small images",
            "type": "boolean",
            "description": "By default images are never made larger than the original. Turn on to enlarge to the exact target size.",
            "default": false
          },
          "backgroundColor": {
            "title": "Background color",
            "type": "string",
            "description": "Used to fill transparent areas when converting to JPG (no transparency support) and for Contain padding. Hex like #ffffff or a color name; 'transparent' keeps padding transparent for WebP/AVIF/PNG.",
            "default": "#ffffff"
          },
          "flattenTransparency": {
            "title": "Always flatten transparency",
            "type": "boolean",
            "description": "Fill transparent areas with the background color even for WebP/AVIF/PNG output.",
            "default": false
          },
          "stripMetadata": {
            "title": "Strip metadata (EXIF, GPS, camera data)",
            "type": "boolean",
            "description": "Remove EXIF data such as GPS location, camera model and timestamps. Saves bytes and protects privacy.",
            "default": true
          },
          "autoOrient": {
            "title": "Apply EXIF orientation",
            "type": "boolean",
            "description": "Rotate phone photos upright using their EXIF orientation tag, so they display correctly after metadata is removed.",
            "default": true
          },
          "colorProfile": {
            "title": "Color profile",
            "enum": [
              "srgb",
              "keep",
              "drop"
            ],
            "type": "string",
            "description": "How to handle embedded ICC color profiles (Adobe RGB, Display P3, etc.).",
            "default": "srgb"
          },
          "keepAnimation": {
            "title": "Keep animation",
            "type": "boolean",
            "description": "Animated GIF/WebP/AVIF/PNG stay animated when converting to WebP, AVIF or PNG (APNG). JPG output always uses the first frame.",
            "default": true
          },
          "filenamePattern": {
            "title": "Output file name pattern",
            "type": "string",
            "description": "Tokens: {name} original file name without extension, {ext}, {format}, {width}, {height}, {index}, {index4} (0001), {hash} (from the original's SHA-256), {quality}. Example: {name}-{width}w.{ext}. Duplicate names get -2, -3.",
            "default": "{name}.{ext}"
          },
          "createZip": {
            "title": "Also create one ZIP of all outputs",
            "type": "boolean",
            "description": "Pack every converted image into converted-images.zip in the key-value store (split into 300 MB parts if needed).",
            "default": false
          },
          "maxImages": {
            "title": "Max images",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many converted images (0 = no limit).",
            "default": 0
          },
          "maxImageSizeMb": {
            "title": "Max input file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped (not charged).",
            "default": 100
          },
          "maxMegapixels": {
            "title": "Max image size (megapixels)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Images with more pixels are skipped. Very large images need more memory: about 1 GB per 60-80 megapixels.",
            "default": 150
          },
          "maxConcurrency": {
            "title": "Parallel images",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many images to process at once. Memory use is also capped automatically by pixel count.",
            "default": 4
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}