{
  "openapi": "3.0.1",
  "info": {
    "title": "Batch Image Converter & Resizer: WebP, AVIF, PNG & JPEG",
    "description": "Convert and resize images in bulk: image URLs in, WebP, AVIF, PNG or JPEG files out with signed download links. Resize by width, height, fit or percent, set quality, strip metadata, hit a max file size. Direct image files only; no HEIC, SVG or web pages.",
    "version": "0.1",
    "x-build-id": "MbDxX5FAFYgOupN2d"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/data-done-right~batch-image-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-data-done-right-batch-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/data-done-right~batch-image-converter/runs": {
      "post": {
        "operationId": "runs-sync-data-done-right-batch-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/data-done-right~batch-image-converter/run-sync": {
      "post": {
        "operationId": "run-sync-data-done-right-batch-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct links to the image files to convert, one per line. JPEG, PNG, WebP, AVIF, GIF, BMP and TIFF are read. Example: https://example.com/photo.jpg. Web pages, SVG and HEIC are not supported. Use only images you have the right to process.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "webp",
              "avif",
              "png",
              "jpeg"
            ],
            "type": "string",
            "description": "Format of every output file. Example: webp. WebP and AVIF are usually the smallest; PNG is lossless; JPEG has no transparency (see Background color).",
            "default": "webp"
          },
          "quality": {
            "title": "Quality (1-100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Lossy quality for WebP, AVIF and JPEG; ignored for PNG. 75-85 looks near-identical for most photos. With a size target this is the highest quality tried. Example: 80.",
            "default": 80
          },
          "lossless": {
            "title": "Lossless WebP/AVIF",
            "type": "boolean",
            "description": "Write WebP and AVIF lossless (bigger files, no pixel loss). PNG is always lossless; JPEG is always lossy and ignores this.",
            "default": false
          },
          "stripMetadata": {
            "title": "Strip metadata",
            "type": "boolean",
            "description": "Remove EXIF (camera, GPS location), XMP and other metadata and the embedded color profile. The orientation is always applied to the pixels first, so photos are never rotated wrongly. Turn off to keep EXIF and the color profile.",
            "default": true
          },
          "backgroundColor": {
            "title": "Background color",
            "type": "string",
            "description": "Replaces transparency when the output is JPEG, and pads the image in fit mode contain. Hex color. Example: #ffffff.",
            "default": "#ffffff"
          },
          "width": {
            "title": "Width (px)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Target or maximum width in pixels. 0 means not set. With fit mode inside the image is scaled down to fit and never enlarged (unless Allow upscaling). Example: 800.",
            "default": 0
          },
          "height": {
            "title": "Height (px)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Target or maximum height in pixels. 0 means not set. Set only one of width and height to keep the aspect ratio. Example: 600.",
            "default": 0
          },
          "fit": {
            "title": "Fit mode",
            "enum": [
              "inside",
              "cover",
              "contain"
            ],
            "type": "string",
            "description": "How width and height are applied. inside keeps the ratio and stays within the box. cover and contain need both width and height and give every image exactly that size (cover crops from the center). Example: inside.",
            "default": "inside"
          },
          "resizePercent": {
            "title": "Resize by percent",
            "minimum": 0,
            "maximum": 400,
            "type": "integer",
            "description": "Scale both sides by this percent, for example 50 for half size or 200 for double. 0 means not set. When set it replaces width, height and fit. Example: 50.",
            "default": 0
          },
          "allowUpscale": {
            "title": "Allow upscaling",
            "type": "boolean",
            "description": "Let width and height enlarge images that are smaller than the box. Off by default. Resize by percent above 100 always enlarges (plain resampling, no AI).",
            "default": false
          },
          "targetSizeKb": {
            "title": "Target file size (KB)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Optional. Lower the quality (WebP, AVIF, JPEG) or the number of colors (PNG) until each file is at most this many kilobytes (1 KB = 1000 bytes). 0 means no target. Each row reports targetMet. Example: 200.",
            "default": 0
          },
          "shrinkToTarget": {
            "title": "Allow smaller pixel size to hit the target",
            "type": "boolean",
            "description": "When quality alone cannot reach the target size, also reduce the pixel dimensions step by step (never below 16 px). Off by default, so the image size only changes when you ask.",
            "default": false
          },
          "maxImages": {
            "title": "Max images",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Most images converted in this run. URLs beyond this are skipped and not charged. Example: 100.",
            "default": 100
          },
          "maxSourceSizeMb": {
            "title": "Max source file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Source images larger than this are skipped before they are fully downloaded. Images above 64 megapixels are always refused (memory safety).",
            "default": 25
          },
          "concurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many images are processed at the same time. Default 4.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}