{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Transform — WebP / JPEG / PNG Batch Converter",
    "description": "Shrink images to WebP, JPEG, or PNG with lossy or lossless encoding, web-ready resize, EXIF stripping. Drop in URLs, upload via KVS, base64, or pipe a scraper's dataset. Photos go ~85% smaller, pages load faster. Tiered pricing $0.002–$0.060/image, $0.005 typical. Sharp-powered, no subscription.",
    "version": "0.0",
    "x-build-id": "oXweulh5Z4LSp032R"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/marielise.dev~image-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-marielise.dev-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/marielise.dev~image-converter/runs": {
      "post": {
        "operationId": "runs-sync-marielise.dev-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/marielise.dev~image-converter/run-sync": {
      "post": {
        "operationId": "run-sync-marielise.dev-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 (any public link)",
            "type": "array",
            "description": "Public image URLs to fetch and transform. Works with any direct image link: your CDN, Cloudflare R2 / S3 public buckets, Google Drive (use `https://drive.google.com/uc?id=FILE_ID&export=download`), Dropbox (replace `?dl=0` with `?dl=1`), Imgur, etc. JPEG / PNG / WebP / GIF / TIFF / AVIF supported. HEIC is skipped (Linux can't decode Apple's HEVC codec — see README).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "inputKvsId": {
            "title": "Input KVS ID (for uploaded files)",
            "type": "string",
            "description": "Apify Key-Value Store ID or name holding source images. Leave blank to use the run's default INPUT store. Workflow: open a KVS in Apify Console → drag files in → list the keys below. This is the way to feed local files into the actor (no public URL needed)."
          },
          "inputKvsKeys": {
            "title": "KVS keys",
            "type": "array",
            "description": "Keys of files inside the KVS specified above (or the default). One key per entry. Each key points to a binary image record uploaded to the store.",
            "items": {
              "type": "string"
            }
          },
          "base64Images": {
            "title": "Inline base64 images",
            "type": "array",
            "description": "Inline images for tiny tests / API integrations. Each entry: `{ \"name\": \"photo.jpg\", \"base64\": \"...\" }`. Don't use this for large batches — use URLs or KVS uploads instead."
          },
          "inputDatasetId": {
            "title": "Input dataset ID (chain from another actor)",
            "type": "string",
            "description": "Pull image URLs from an existing Apify dataset. The actor reads the field named in `urlField` from each item. Use this to chain image-transform after a scraper actor."
          },
          "urlField": {
            "title": "URL field name",
            "type": "string",
            "description": "Which field on each input dataset item holds the image URL. Only used when `inputDatasetId` is set.",
            "default": "url"
          },
          "format": {
            "title": "Output format",
            "enum": [
              "webp",
              "jpeg",
              "png"
            ],
            "type": "string",
            "description": "Encoded output format. WebP gives the best size/quality tradeoff for the modern web. JPEG is universal. PNG is lossless and supports transparency.",
            "default": "webp"
          },
          "mode": {
            "title": "Encoding mode",
            "enum": [
              "lossy",
              "lossless"
            ],
            "type": "string",
            "description": "Default `lossy` is best for PHOTOS. Switch to `lossless` for logos, icons, screenshots, or UI assets — lossy makes hard edges fuzzy and adds ringing around text. WebP only — ignored for JPEG (always lossy) and PNG (always lossless).",
            "default": "lossy"
          },
          "quality": {
            "title": "Quality (1-100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Encoder quality. Used for JPEG always, and for WebP in lossy mode. Ignored for PNG. 75-85 is the sweet spot for web photos.",
            "default": 82
          },
          "maxWidth": {
            "title": "Max width (px)",
            "minimum": 0,
            "type": "integer",
            "description": "Cap output width. 0 = no limit. Aspect ratio is preserved unless you change `fit`. Images smaller than this are NOT upscaled.",
            "default": 2000
          },
          "maxHeight": {
            "title": "Max height (px)",
            "minimum": 0,
            "type": "integer",
            "description": "Cap output height. 0 = no limit. Aspect ratio is preserved unless you change `fit`. Images smaller than this are NOT upscaled.",
            "default": 2000
          },
          "fit": {
            "title": "Resize fit",
            "enum": [
              "inside",
              "cover",
              "contain"
            ],
            "type": "string",
            "description": "How the image fits the max box. `inside` preserves aspect ratio without cropping (recommended). `cover` fills the box and crops overflow. `contain` fits inside and pads to box size.",
            "default": "inside"
          },
          "stripMetadata": {
            "title": "Strip metadata",
            "type": "boolean",
            "description": "Drop EXIF / ICC / XMP metadata for smaller, privacy-safe web output. EXIF orientation is honored before stripping (so portrait photos stay portrait).",
            "default": true
          },
          "effort": {
            "title": "Encoder effort (0-9)",
            "minimum": 0,
            "maximum": 9,
            "type": "integer",
            "description": "Higher = smaller files, slower encode. WebP uses 0-6, PNG uses 0-9 (compressionLevel), JPEG ignores this.",
            "default": 4
          },
          "outputKvsKeyTemplate": {
            "title": "Output KVS key template",
            "type": "string",
            "description": "Controls how transformed files are named in the run's key-value store. Tokens: `{slug}` (slugified source filename), `{format}` (output extension), `{index}` (zero-padded counter), `{originalName}` (raw source filename, no slugification). Default produces e.g. `photo_1015.webp`.",
            "default": "{slug}.{format}"
          },
          "slugifyFilenames": {
            "title": "Slugify filenames",
            "type": "boolean",
            "description": "Strip diacritics, spaces, and special characters from `{slug}` to produce URL/file-safe keys. Recommended on. Disable only if you need the original filename verbatim (use `{originalName}` instead).",
            "default": true
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 0,
            "maximum": 32,
            "type": "integer",
            "description": "How many images to process in parallel. sharp is CPU-bound, so the sweet spot is roughly the number of CPU cores. Default 0 = auto (matches CPU count).",
            "default": 0
          },
          "useApifyProxy": {
            "title": "Use Apify Proxy for source fetches",
            "type": "boolean",
            "description": "Route the URL fetch step through Apify Proxy (datacenter group). Recommended for high-volume runs so you don't hammer source CDNs from a single IP. Has no effect when `inputDatasetId` is the only source.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}