{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Converter & Compressor — Resize, WebP/AVIF, Bulk",
    "description": "Convert and compress images in bulk: JPEG, PNG, HEIC (iPhone), GIF, SVG, TIFF to WebP, AVIF, JPEG, PNG or PDF. Resize, hit a target file size, strip EXIF and GPS, merge images into one PDF, optional ZIP. $2 per 1,000 images.",
    "version": "0.1",
    "x-build-id": "RDfngR4JmVG7mvlqW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/actor-forge~image-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-actor-forge-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/actor-forge~image-converter/runs": {
      "post": {
        "operationId": "runs-sync-actor-forge-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/actor-forge~image-converter/run-sync": {
      "post": {
        "operationId": "run-sync-actor-forge-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": [
          "imageUrls"
        ],
        "properties": {
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct links to the images to convert (JPEG, PNG, WebP, AVIF, HEIC/HEIF from iPhones, GIF, TIFF or SVG; the format is detected from the file itself). Up to 25 MB and 50 megapixels per image. To convert every image on a web page, collect the links first with our Bulk Image Downloader.",
            "items": {
              "type": "string"
            }
          },
          "format": {
            "title": "Output format",
            "enum": [
              "webp",
              "avif",
              "jpeg",
              "png",
              "pdf",
              "keep"
            ],
            "type": "string",
            "description": "WebP is the best all-round choice for websites (about 25-35% smaller than JPEG). AVIF is smaller still but slower to encode. JPEG is the most compatible (e.g. for iPhone HEIC photos). PDF puts the images into a PDF document (see the PDF options below). 'Keep' re-compresses each image in its own format (SVG becomes PNG, HEIC becomes JPEG).",
            "default": "webp"
          },
          "quality": {
            "title": "Quality (1-100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Lower = smaller files. 75-85 is visually lossless for most photos. For PNG, anything below 100 reduces the colour palette (the TinyPNG technique); 100 = lossless.",
            "default": 80
          },
          "width": {
            "title": "Max width (px)",
            "minimum": 0,
            "maximum": 16384,
            "type": "integer",
            "description": "Resize so the image is at most this wide. Empty = keep the original width. Images are never enlarged."
          },
          "height": {
            "title": "Max height (px)",
            "minimum": 0,
            "maximum": 16384,
            "type": "integer",
            "description": "Resize so the image is at most this tall. Empty = keep the original height."
          },
          "fit": {
            "title": "Resize mode",
            "enum": [
              "inside",
              "cover",
              "contain"
            ],
            "type": "string",
            "description": "When both width and height are set: 'inside' keeps the aspect ratio within the box, 'cover' crops to fill the box exactly, 'contain' pads to the box with the background colour.",
            "default": "inside"
          },
          "background": {
            "title": "Background colour",
            "type": "string",
            "description": "Hex colour used for padding ('contain') and for transparent areas when converting to JPEG.",
            "default": "#ffffff"
          },
          "stripMetadata": {
            "title": "Strip metadata (EXIF, GPS)",
            "type": "boolean",
            "description": "Remove EXIF, GPS location, camera details, XMP and IPTC from the output (photos are rotated upright first). Smaller files and no leaked locations. Each row still reports whether the original had EXIF / GPS.",
            "default": true
          },
          "maxFileSizeKb": {
            "title": "Target max file size (KB)",
            "minimum": 0,
            "type": "number",
            "description": "Optional. Lowers the quality step by step (and, if needed, the dimensions) until each image fits under this size. Rows show the quality used and whether the target was met."
          },
          "keepAnimation": {
            "title": "Keep GIF / WebP animation",
            "type": "boolean",
            "description": "Animated GIF or WebP converted to WebP keep all frames. Off = first frame only. AVIF, JPEG and PNG output always use the first frame.",
            "default": true
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "links",
              "zip",
              "both"
            ],
            "type": "string",
            "description": "'Links' saves each image with its own download link. 'ZIP' bundles all images into ZIP files (up to 200 MB each; links in the OUTPUT record). 'Both' does both. A merged PDF is always a download link.",
            "default": "links"
          },
          "filenamePattern": {
            "title": "File name pattern",
            "type": "string",
            "description": "Tokens: {index} (00001…), {name} (original file name), {width}, {height}, {format}. The extension is added automatically; duplicate names get a -2, -3… suffix.",
            "default": "{index}-{name}"
          },
          "maxImages": {
            "title": "Max images",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after converting this many images.",
            "default": 1000
          },
          "pdfMode": {
            "title": "PDF mode",
            "enum": [
              "merge",
              "separate"
            ],
            "type": "string",
            "description": "'Merge' puts all images into one PDF, one image per page, in the order of your list. 'Separate' makes one PDF per image.",
            "default": "merge"
          },
          "pdfPageSize": {
            "title": "Page size",
            "enum": [
              "fit",
              "a4",
              "letter"
            ],
            "type": "string",
            "description": "'Fit image' makes each page exactly the size of its image (96 dpi). A4 and Letter pages turn portrait or landscape to match each image, which is scaled to fill the page inside the margin.",
            "default": "fit"
          },
          "pdfMarginMm": {
            "title": "Page margin (mm)",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "White margin around the image on A4 and Letter pages. 'Fit image' pages have no margin.",
            "default": 10
          },
          "pdfFileName": {
            "title": "PDF file name",
            "type": "string",
            "description": "Name of the merged PDF (without .pdf). Very large merges are split into parts: name.pdf, name-part-2.pdf, ...",
            "default": "images"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}