{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Converter & Optimizer (WebP, AVIF, JPEG, PNG)",
    "description": "Bulk-convert and compress images from URLs or a dataset to WebP, AVIF, JPEG or PNG. Resize, crop, fix orientation, strip metadata, hit a target file size. Failed images are free.",
    "version": "0.1",
    "x-build-id": "XXJzoRcLdRt3VRGVh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cellwright~image-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cellwright-image-converter",
        "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/cellwright~image-converter/runs": {
      "post": {
        "operationId": "runs-sync-cellwright-image-converter",
        "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/cellwright~image-converter/run-sync": {
      "post": {
        "operationId": "run-sync-cellwright-image-converter",
        "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": {
          "images": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct URLs of the images to convert (JPEG, PNG, GIF, WebP, AVIF, BMP, TIFF, ICO). One output file and one dataset row per image. Max 50 MB per file.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "datasetId": {
            "title": "Or: dataset with image URLs",
            "type": "string",
            "description": "Optional. Take image URLs from a dataset, e.g. the output of a product or listing scraper. Combined with 'Image URLs'."
          },
          "urlField": {
            "title": "Dataset field with image URL(s)",
            "type": "string",
            "description": "Field of the dataset items that holds the image URL or a list of URLs (dot path allowed, e.g. 'product.image'). Empty = auto-detect imageUrl, image, url, src, imageUrls, images, thumbnailUrl, photo."
          },
          "format": {
            "title": "Output format",
            "enum": [
              "webp",
              "avif",
              "jpeg",
              "png",
              "gif",
              "original"
            ],
            "type": "string",
            "description": "Target format. WebP: best all-rounder for websites. AVIF: smallest files, slower. JPEG: maximum compatibility (no transparency). PNG: lossless. 'original' keeps the format and only resizes/compresses.",
            "default": "webp"
          },
          "quality": {
            "title": "Quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Quality for WebP, AVIF and JPEG (1–100). 75–85 is visually lossless for most photos.",
            "default": 80
          },
          "width": {
            "title": "Width (px)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum width (fit 'inside') or exact width (fit 'cover' / 'contain'). 0 = keep.",
            "default": 0
          },
          "height": {
            "title": "Height (px)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum height (fit 'inside') or exact height (fit 'cover' / 'contain'). 0 = keep.",
            "default": 0
          },
          "fit": {
            "title": "Resize mode",
            "enum": [
              "inside",
              "cover",
              "contain"
            ],
            "type": "string",
            "description": "inside: scale down to fit within width/height, keep aspect ratio. cover: fill exactly width x height, crop the overflow (thumbnails). contain: fit inside width x height and pad with the background colour.",
            "default": "inside"
          },
          "upscale": {
            "title": "Allow upscaling",
            "type": "boolean",
            "description": "With fit 'inside': also enlarge images smaller than width/height. Off by default.",
            "default": false
          },
          "background": {
            "title": "Background colour",
            "type": "string",
            "description": "Hex colour used to flatten transparency for JPEG and to pad in 'contain' mode, e.g. #ffffff. 'transparent' pads with transparency (WebP, AVIF, PNG).",
            "default": "#ffffff"
          },
          "targetSizeKb": {
            "title": "Target file size (kB)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Optional. For WebP, AVIF and JPEG: lower the quality step by step (not below 'Minimum quality') until the file is at most this size. 0 = off.",
            "default": 0
          },
          "minQuality": {
            "title": "Minimum quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Lowest quality the target-size search may use.",
            "default": 40
          },
          "lossless": {
            "title": "Lossless WebP / AVIF",
            "type": "boolean",
            "description": "Encode WebP/AVIF without quality loss (larger files; good for logos, screenshots, graphics).",
            "default": false
          },
          "stripMetadata": {
            "title": "Strip metadata (EXIF, GPS)",
            "type": "boolean",
            "description": "Remove EXIF data such as camera details and GPS location. The orientation is always applied to the pixels first, so images never end up rotated.",
            "default": true
          },
          "keepColorProfile": {
            "title": "Keep colour profile",
            "type": "boolean",
            "description": "Keep the embedded ICC colour profile so colours look the same (recommended).",
            "default": true
          },
          "keepAnimation": {
            "title": "Keep animation",
            "type": "boolean",
            "description": "Animated GIF/WebP/APNG stay animated when the output format supports it (WebP, AVIF, PNG, GIF). Off = first frame only. Max 300 frames.",
            "default": true
          },
          "progressive": {
            "title": "Progressive JPEG",
            "type": "boolean",
            "description": "Write progressive JPEGs (load gradually in browsers, usually slightly smaller).",
            "default": true
          },
          "maxImages": {
            "title": "Max images",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Upper limit of images processed in this run (protects your budget when reading a large dataset).",
            "default": 1000
          },
          "maxConcurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many images are downloaded at the same time.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}