{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Converter & Resizer: WebP, AVIF, JPG, PNG in Bulk",
    "description": "Convert images in bulk to WebP, AVIF, JPEG or PNG: resize, crop, compress to a target file size and strip EXIF/GPS metadata. Image URLs or a dataset column in, download links and an optional ZIP out. Failed images are free.",
    "version": "0.0",
    "x-build-id": "gIQ58BmATk9FRkoLh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/charlesmarkette~image-converter-resizer-webp-avif-jpg-png/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-charlesmarkette-image-converter-resizer-webp-avif-jpg-png",
        "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/charlesmarkette~image-converter-resizer-webp-avif-jpg-png/runs": {
      "post": {
        "operationId": "runs-sync-charlesmarkette-image-converter-resizer-webp-avif-jpg-png",
        "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/charlesmarkette~image-converter-resizer-webp-avif-jpg-png/run-sync": {
      "post": {
        "operationId": "run-sync-charlesmarkette-image-converter-resizer-webp-avif-jpg-png",
        "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": "One per line. Direct links to JPEG, PNG, WebP, GIF, AVIF, TIFF, BMP or HEIC images. Google Drive and Dropbox share links to a single file work too. The format is detected from the file itself, so links without an extension are fine.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset to convert",
            "type": "string",
            "description": "Optional. A dataset from another run with image links (product photos, profile pictures, listing images…). For each item, the first field below that holds an image URL is converted and the result columns are added next to the item's fields. A field holding a list of URLs gives one row per image. Use {{resource.defaultDatasetId}} in an integration."
          },
          "urlFields": {
            "title": "Image URL fields",
            "type": "array",
            "description": "Item fields to take the image URL from, in order of preference. Dotted paths work (product.image). Default: imageUrl, imageUrls, image, images, thumbnailUrl, thumbnail, photo, src, url.",
            "items": {
              "type": "string"
            }
          },
          "keepItemFields": {
            "title": "Keep the item's original fields",
            "type": "boolean",
            "description": "On: each output row is the original item plus the image columns (image columns win if a name clashes). Off: only the image columns.",
            "default": true
          },
          "format": {
            "title": "Output format",
            "enum": [
              "webp",
              "avif",
              "jpeg",
              "png",
              "keep"
            ],
            "type": "string",
            "description": "WebP: small files that every current browser shows. AVIF: usually smaller still, slower to encode. JPEG: works everywhere (transparency is filled with the background colour). PNG: lossless, keeps transparency. Keep: the original format (HEIC becomes JPEG), handy for resizing or stripping metadata only.",
            "default": "webp"
          },
          "quality": {
            "title": "Quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "1–100, for JPEG, WebP and AVIF. 80 is a good balance for photos; 90+ for near-lossless; 60–70 for thumbnails. PNG and GIF ignore it.",
            "default": 80
          },
          "lossless": {
            "title": "Lossless WebP",
            "type": "boolean",
            "description": "WebP only: pixel-exact output (best for logos, screenshots and graphics; larger for photos). PNG is always lossless.",
            "default": false
          },
          "targetMaxBytes": {
            "title": "Target max file size (bytes)",
            "minimum": 1000,
            "type": "integer",
            "description": "Optional, for JPEG, WebP and AVIF. The highest quality (up to the Quality above) whose file fits under this size is picked, e.g. 200000 for 200 KB. If even quality 1 is larger, the smallest file is kept and the row says targetMet: false. Combine with Max width for big photos."
          },
          "maxWidth": {
            "title": "Max width (px)",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Optional. Images wider than this are scaled down, keeping the aspect ratio."
          },
          "maxHeight": {
            "title": "Max height (px)",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Optional. Images taller than this are scaled down, keeping the aspect ratio."
          },
          "fit": {
            "title": "Resize mode",
            "enum": [
              "inside",
              "cover",
              "exact"
            ],
            "type": "string",
            "description": "Inside: fit within the max width and height (nothing cropped). Cover: fill the whole width × height box and crop the overflow from the centre (square thumbnails, banners); needs both sizes. Exact: stretch to exactly width × height, ignoring the aspect ratio; needs both sizes.",
            "default": "inside"
          },
          "allowUpscale": {
            "title": "Enlarge smaller images",
            "type": "boolean",
            "description": "Off: images smaller than the box are never enlarged (Cover then crops to the box shape at the image's own size). On: they are scaled up to the box. Exact always gives the exact size.",
            "default": false
          },
          "stripMetadata": {
            "title": "Remove metadata (EXIF, GPS location)",
            "type": "boolean",
            "description": "On: EXIF data is removed, including GPS location, camera and date. The EXIF rotation is applied to the pixels first, so photos still display the right way up. The colour profile is kept so colours don't shift. Off: EXIF (with GPS, if present) is copied to JPEG, WebP, AVIF, PNG and TIFF output.",
            "default": true
          },
          "background": {
            "title": "Background colour",
            "type": "string",
            "description": "Hex colour that transparent areas are filled with when the output format has no transparency (JPEG, BMP).",
            "default": "#ffffff"
          },
          "keepAnimation": {
            "title": "Keep animation",
            "type": "boolean",
            "description": "For animated GIF, WebP and PNG input with WebP or GIF output: keep all frames and their timing. Off (and for other output formats): the first frame is converted.",
            "default": false
          },
          "outputNameTemplate": {
            "title": "File name template",
            "type": "string",
            "description": "Name of each converted file in the key-value store; the extension is added. Placeholders: {name} (original file name), {index} (position in the input), {width}, {height}, {format}, {hash} (8 characters from the source URL). Example: {name}-{width}w. Repeated names get -2, -3…",
            "default": "{name}"
          },
          "createZip": {
            "title": "Also create a ZIP of all files",
            "type": "boolean",
            "description": "Store all converted files in one ZIP (converted-images.zip) as well. Its link is in the run summary (OUTPUT).",
            "default": false
          },
          "dedupe": {
            "title": "Convert each URL once",
            "type": "boolean",
            "description": "Skip repeats of the same image URL (no row, no charge).",
            "default": true
          },
          "concurrency": {
            "title": "Images in parallel",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many images are downloaded and converted at once (1–16). Very large images are also limited by the run's memory.",
            "default": 4
          },
          "maxFileSizeMb": {
            "title": "Max download size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger source files are skipped with an error row (free).",
            "default": 25
          },
          "maxResults": {
            "title": "Max output rows",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap on output rows (one row per image URL, including free error rows)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}