{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk Image Converter & Resizer: WebP, JPG, PNG to ZIP",
    "description": "Convert, resize and compress images in bulk: WebP, JPEG, PNG, AVIF. White-square product photo presets, target file size in KB, SKU file names from a CSV or dataset, one ZIP. Reads Bulk File Downloader results directly. $0.70 per 1,000 images; failed images are free.",
    "version": "0.0",
    "x-build-id": "LhK61PhnFbjvfUh0a"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/chris_elder~bulk-image-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-chris_elder-bulk-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/chris_elder~bulk-image-converter/runs": {
      "post": {
        "operationId": "runs-sync-chris_elder-bulk-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/chris_elder~bulk-image-converter/run-sync": {
      "post": {
        "operationId": "run-sync-chris_elder-bulk-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": {
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Links to images (JPG, PNG, WebP, AVIF, GIF, TIFF, SVG). One per line. Each converted image costs one event; failed images are free.",
            "items": {
              "type": "string"
            }
          },
          "csvUrl": {
            "title": "CSV, text list or Google Sheet link (optional)",
            "type": "string",
            "description": "A public CSV/TSV/text file or a Google Sheet shared as \"Anyone with the link can view\". The image column is found automatically (for example a Shopify export's \"Image Src\"), or set it below."
          },
          "datasetId": {
            "title": "Apify dataset ID (optional)",
            "type": "string",
            "description": "Convert the images from another Actor's results: paste the dataset ID from the run's Storage tab. Read-only access to this one dataset is requested. Bulk File Downloader results are recognised automatically; failed rows are skipped."
          },
          "keyValueStoreId": {
            "title": "Bulk File Downloader key-value store ID (optional)",
            "type": "string",
            "description": "With a Bulk File Downloader dataset, also paste that run's key-value store ID to convert the files it already saved instead of downloading them again. Read-only access to this one store is requested."
          },
          "urlField": {
            "title": "URL field / column (optional)",
            "type": "string",
            "description": "Dataset field (dotted paths like images.0 work, arrays of links are expanded) or CSV column holding the image links. Left empty, it is detected."
          },
          "nameField": {
            "title": "Name / SKU field or column (optional)",
            "type": "string",
            "description": "Dataset field or CSV column used to name each output file, for example SKU or Handle. Repeats get -2, -3."
          },
          "preset": {
            "title": "Preset",
            "enum": [
              "none",
              "square-2048-white",
              "square-1600-white",
              "square-1000-white",
              "web-1600-webp",
              "thumbnail-400-webp",
              "compress-only"
            ],
            "type": "string",
            "description": "Ready-made settings. Any option you set below overrides the preset. Square presets trim plain borders, centre the product with a 5% margin and pad it onto a white square.",
            "default": "none"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "webp",
              "jpeg",
              "png",
              "avif",
              "same"
            ],
            "type": "string",
            "description": "\"Same as input\" keeps JPEG/PNG/WebP/AVIF and turns other formats into JPEG (or PNG when transparent). JPEG output puts transparent areas on the background colour. Default WebP (or the preset's format)."
          },
          "quality": {
            "title": "Quality (1 to 100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Encoder quality for JPEG, WebP and AVIF. Default 80 (85 on product presets). PNG is lossless unless a target size is set."
          },
          "targetKb": {
            "title": "Target file size in KB (optional)",
            "minimum": 5,
            "type": "integer",
            "description": "Highest quality that fits under this size is picked per image. Each row reports targetMet. No extra cost."
          },
          "width": {
            "title": "Width in px (optional)",
            "minimum": 1,
            "maximum": 12000,
            "type": "integer",
            "description": "Target width. Leave empty to keep the aspect ratio from the height, or keep the original size."
          },
          "height": {
            "title": "Height in px (optional)",
            "minimum": 1,
            "maximum": 12000,
            "type": "integer",
            "description": "Target height."
          },
          "fit": {
            "title": "Resize mode",
            "enum": [
              "inside",
              "contain",
              "cover",
              "fill"
            ],
            "type": "string",
            "description": "inside: fit within the box, keep ratio. contain: fit and pad to the exact box with the background colour. cover: fill the box and crop. fill: stretch."
          },
          "allowUpscale": {
            "title": "Allow enlarging small images",
            "type": "boolean",
            "description": "Off: images smaller than the target are not enlarged (pad mode still pads to the exact size). Product presets turn this on."
          },
          "backgroundColor": {
            "title": "Background colour",
            "type": "string",
            "description": "Hex colour for padding and for transparent areas in JPEG output. Default #ffffff."
          },
          "trim": {
            "title": "Trim plain borders",
            "type": "boolean",
            "description": "Remove plain borders around the subject before resizing. On for product presets."
          },
          "marginPercent": {
            "title": "Margin around the subject (%)",
            "minimum": 0,
            "maximum": 40,
            "type": "integer",
            "description": "Empty space on each side in pad mode, as a percent of the canvas. Product presets use 5."
          },
          "stripMetadata": {
            "title": "Remove metadata (EXIF, GPS)",
            "type": "boolean",
            "description": "Removes camera and location data and makes files smaller. Default on.",
            "default": true
          },
          "autoRotate": {
            "title": "Auto-rotate from EXIF",
            "type": "boolean",
            "description": "Rotate phone photos upright using their EXIF orientation. Default on.",
            "default": true
          },
          "fileNameTemplate": {
            "title": "File name template",
            "type": "string",
            "description": "Tokens: {name} (original file name or the name/SKU field), {sku}, {index}, {width}, {height}. Example: {sku}-{width}x{height}. The extension is added for you.",
            "default": "{name}"
          },
          "createZip": {
            "title": "Create a ZIP of all images",
            "type": "boolean",
            "description": "Saves images.zip (split into parts for very large runs) in the key-value store. Free.",
            "default": true
          },
          "maxImages": {
            "title": "Maximum images",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many images (1 to 10,000). Use Apify's Max cost per run as a spending cap too.",
            "default": 100
          },
          "maxInputMb": {
            "title": "Maximum input image size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger images are skipped and not charged.",
            "default": 30
          },
          "maxConcurrency": {
            "title": "Parallel images",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many images are processed at once (1 to 8).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}