{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Compressor & Converter: WebP, AVIF, JPEG, PNG, HEIC",
    "description": "Bulk image compression and conversion: compress JPEG/PNG, convert to WebP or AVIF, HEIC to JPG, resize, hit a target file size and strip EXIF/GPS metadata. Download links per image plus an optional ZIP. $1 per 1,000 images, failed images free.",
    "version": "1.0",
    "x-build-id": "Roan5w4pugjWOr85B"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/manageable_gully~image-compressor-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-manageable_gully-image-compressor-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/manageable_gully~image-compressor-converter/runs": {
      "post": {
        "operationId": "runs-sync-manageable_gully-image-compressor-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/manageable_gully~image-compressor-converter/run-sync": {
      "post": {
        "operationId": "run-sync-manageable_gully-image-compressor-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 links",
            "type": "array",
            "description": "Direct links to image files: JPEG, PNG, WebP, AVIF, HEIC/HEIF (iPhone), GIF (incl. animated), TIFF, BMP. Max 50 MB and 100 megapixels each, up to 5,000 per run. Google Drive (shared as 'Anyone with the link') and Dropbox share links work. Web pages are refused: use the image's own address.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "uploadedFile": {
            "title": "Or upload an image",
            "type": "string",
            "description": "Upload one image from your computer instead of (or in addition to) links."
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "webp",
              "avif",
              "jpeg",
              "png",
              "keep"
            ],
            "type": "string",
            "description": "Format of the converted images. 'Keep' compresses in the same format (HEIC, TIFF and BMP become JPEG, or PNG when they have transparency).",
            "default": "webp"
          },
          "quality": {
            "title": "Quality (1-100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "For JPEG, WebP and AVIF. 75-85 looks the same as the original for most photos; lower = smaller files. Ignored for PNG and lossless output.",
            "default": 80
          },
          "maxWidth": {
            "title": "Max width (px)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Shrink images wider than this, keeping the aspect ratio. 0 = keep the original width. Images are never enlarged.",
            "default": 0
          },
          "maxHeight": {
            "title": "Max height (px)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Shrink images taller than this, keeping the aspect ratio. 0 = keep the original height.",
            "default": 0
          },
          "targetMaxSizeKB": {
            "title": "Target max file size (KB)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Make every file at most this big (e.g. 200 for a 200 KB upload limit). Lowers the quality step by step and, if needed, the resolution. 0 = off.",
            "default": 0
          },
          "resizeToReachTarget": {
            "title": "Allow resizing to reach the target size",
            "type": "boolean",
            "description": "If lowering the quality is not enough, scale the image down until it fits the target size.",
            "default": true
          },
          "stripMetadata": {
            "title": "Remove metadata",
            "enum": [
              "all",
              "gps",
              "none"
            ],
            "type": "string",
            "description": "Photos from phones often contain the exact GPS location where they were taken. By default all EXIF and XMP metadata is removed. The camera rotation is always applied to the pixels first, so images never end up sideways.",
            "default": "all"
          },
          "keepColorProfile": {
            "title": "Keep the color profile (ICC)",
            "type": "boolean",
            "description": "Keeps colors accurate for wide-gamut photos (e.g. iPhone Display P3). Turn off to save a few more KB.",
            "default": true
          },
          "pngReduceColors": {
            "title": "PNG: reduce to 256 colors (TinyPNG-style)",
            "type": "boolean",
            "description": "Lossy PNG compression: usually 50-80% smaller PNGs with hardly visible change. Best for screenshots, logos and illustrations.",
            "default": false
          },
          "lossless": {
            "title": "Lossless WebP / AVIF",
            "type": "boolean",
            "description": "Pixel-perfect WebP/AVIF (bigger files). Good for screenshots and graphics.",
            "default": false
          },
          "backgroundColor": {
            "title": "Background for transparent images (JPEG)",
            "type": "string",
            "description": "JPEG has no transparency: transparent areas are filled with this hex color.",
            "default": "#ffffff"
          },
          "createZip": {
            "title": "Also create a ZIP of all images",
            "type": "boolean",
            "description": "Adds images.zip (all converted images, max 300 MB) to the run's key-value store. Free.",
            "default": false
          },
          "keepOriginalIfSmaller": {
            "title": "Keep the original if re-encoding makes it bigger",
            "type": "boolean",
            "description": "When the format and size stay the same and the original is already smaller (and has no metadata to remove), the original file is returned as is.",
            "default": true
          },
          "maxMegapixels": {
            "title": "Max megapixels per image",
            "minimum": 1,
            "maximum": 150,
            "type": "integer",
            "description": "Images above this are skipped (not charged). Above 100 MP give the run 2 GB of memory or more.",
            "default": 100
          },
          "avifSpeed": {
            "title": "AVIF encoder speed (0-10)",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Higher = faster, slightly bigger AVIF files. 7 is a good balance.",
            "default": 7
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}