{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk Image Optimizer: WebP, AVIF Converter & Compressor",
    "description": "Compress, resize and convert images in bulk from URLs to WebP, AVIF, JPEG or PNG. Get download links, sizes before/after, % saved, dimensions. No API key, no login. MCP-ready for Claude, Cursor, ChatGPT. Pay per result, no monthly rental. Errors are free. $2 per 1,000 images.",
    "version": "0.1",
    "x-build-id": "9dcwKfJLAFYWdVtEo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/actose~bulk-image-optimizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-actose-bulk-image-optimizer",
        "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/actose~bulk-image-optimizer/runs": {
      "post": {
        "operationId": "runs-sync-actose-bulk-image-optimizer",
        "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/actose~bulk-image-optimizer/run-sync": {
      "post": {
        "operationId": "run-sync-actose-bulk-image-optimizer",
        "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": [
          "imageUrls"
        ],
        "properties": {
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Public URLs of the images to optimize (JPEG, PNG, WebP, AVIF, GIF, TIFF, BMP, HEIC). One URL per line. Duplicates are processed once; broken URLs are reported in the dataset and never billed.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "webp",
              "avif",
              "jpeg",
              "png",
              "original"
            ],
            "type": "string",
            "description": "Format of the optimized files. WebP is supported by all modern browsers and is usually 25-35% lighter than JPEG; AVIF is even lighter but slower to encode. \"original\" keeps the source format (JPEG, PNG, WebP or AVIF) and only compresses/resizes.",
            "default": "webp"
          },
          "quality": {
            "title": "Quality (1-100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Compression quality for WebP, AVIF and JPEG. 75-85 is visually lossless for product photos. Ignored for PNG.",
            "default": 80
          },
          "maxWidth": {
            "title": "Max width (px)",
            "minimum": 1,
            "maximum": 16000,
            "type": "integer",
            "description": "Resize images wider than this (aspect ratio kept, never upscaled). Leave empty to keep the original width."
          },
          "maxHeight": {
            "title": "Max height (px)",
            "minimum": 1,
            "maximum": 16000,
            "type": "integer",
            "description": "Resize images taller than this (aspect ratio kept, never upscaled). Leave empty to keep the original height."
          },
          "fit": {
            "title": "Resize mode",
            "enum": [
              "inside",
              "cover",
              "contain"
            ],
            "type": "string",
            "description": "\"inside\": fit within max width/height, keep proportions, never upscale. \"cover\": crop to exactly max width × max height (centered, e.g. square thumbnails). \"contain\": letterbox to exactly max width × max height with the background color. cover/contain need both max width and max height.",
            "default": "inside"
          },
          "lossless": {
            "title": "Lossless (WebP / AVIF)",
            "type": "boolean",
            "description": "Encode WebP/AVIF without any quality loss (bigger files). Useful for logos, icons and screenshots.",
            "default": false
          },
          "pngColors": {
            "title": "PNG palette colors (2-256)",
            "minimum": 2,
            "maximum": 256,
            "type": "integer",
            "description": "For PNG output only: reduce to a palette of this many colors (like pngquant) for 50-80% smaller PNGs. Leave empty for lossless PNG."
          },
          "backgroundColor": {
            "title": "Background color",
            "type": "string",
            "description": "Hex color used to fill transparent areas when converting to JPEG and for the padding of \"contain\" mode.",
            "default": "#ffffff"
          },
          "keepMetadata": {
            "title": "Keep EXIF metadata",
            "type": "boolean",
            "description": "Keep EXIF data (camera, date, GPS...). Off by default: stripping it makes files smaller and protects privacy. Color profiles (ICC) are always kept and orientation is always applied.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new images (for scheduled runs)",
            "type": "boolean",
            "description": "Skip URLs already optimized with the same settings in a previous run (remembered in the named key-value store \"bulk-image-optimizer-state\"). Ideal for a daily schedule on a growing catalog: you only pay for new images.",
            "default": false
          },
          "storeName": {
            "title": "Key-value store name",
            "type": "string",
            "description": "Optional named key-value store where the files are saved (named stores are kept indefinitely). Empty = the run's default store."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Number of images downloaded in parallel. Lower it if the image server rate-limits you.",
            "default": 4
          },
          "maxInputSizeMb": {
            "title": "Max source file size (MB)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Source images heavier than this are skipped (reported, not billed).",
            "default": 25
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}