{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Optimizer & Converter: Website Images to WebP, AVIF",
    "description": "Compress and convert images to WebP, AVIF, JPEG, PNG or GIF: from URLs, every image a web page shows, or a scraper's dataset. Under a target size in KB, fitted, cropped or padded to an exact size, EXIF and GPS removed, HEIC read, a ZIP of all. Failures are free.",
    "version": "0.1",
    "x-build-id": "5pk3yt8KiIKGcuKdc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pikoulas~image-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pikoulas-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/pikoulas~image-converter/runs": {
      "post": {
        "operationId": "runs-sync-pikoulas-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/pikoulas~image-converter/run-sync": {
      "post": {
        "operationId": "run-sync-pikoulas-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": {
          "urls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Addresses of images: JPEG, PNG, WebP, AVIF, HEIC, GIF, TIFF or BMP, up to 50 MB and 100 megapixels each. One over 16 megapixels counts as an image per started 16.",
            "items": {
              "type": "string"
            }
          },
          "pageUrls": {
            "title": "Web pages",
            "type": "array",
            "description": "Pages whose images to convert: each one they show (the largest of a srcset, lazy-loaded ones too) and their social preview image, with its alt text. SVG and icons are left out. Reading a page is free.",
            "items": {
              "type": "string"
            }
          },
          "maxImagesPerPage": {
            "title": "Images per page",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "The first this many images of each page.",
            "default": 100
          },
          "datasetIds": {
            "title": "Apify datasets",
            "type": "array",
            "description": "Datasets from your account, a scraper's results say, whose image URLs to convert."
          },
          "urlFields": {
            "title": "Dataset fields with the URLs",
            "type": "array",
            "description": "Fields holding an image URL or a list of them, like imageUrl or images, nested ones by dotted path. Empty: every URL in each row that ends in an image's extension.",
            "items": {
              "type": "string"
            }
          },
          "format": {
            "title": "Convert to",
            "enum": [
              "webp",
              "avif",
              "jpeg",
              "png",
              "gif",
              "original"
            ],
            "type": "string",
            "description": "The format of the files you get. Original keeps JPEG, PNG, WebP, AVIF and GIF as they are and turns the rest (HEIC, TIFF, BMP) into JPEG.",
            "default": "webp"
          },
          "quality": {
            "title": "Quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "For WebP, AVIF and JPEG: lower makes smaller files. PNG and GIF are lossless and only compressed.",
            "default": 80
          },
          "maxKilobytes": {
            "title": "Max file size",
            "minimum": 1,
            "type": "integer",
            "description": "Each file at most this size: WebP, AVIF and JPEG take the highest quality that fits, and an image still over it at quality 10 (or a PNG or GIF over it) is shrunk until it fits."
          },
          "maxWidth": {
            "title": "Width",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Images wider than this are scaled down to it, keeping their proportions; smaller ones aren't enlarged. With Fit cover or pad, the exact width."
          },
          "maxHeight": {
            "title": "Height",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Images taller than this are scaled down to it, keeping their proportions; smaller ones aren't enlarged. With Fit cover or pad, the exact height."
          },
          "fit": {
            "title": "Fit",
            "enum": [
              "inside",
              "cover",
              "pad"
            ],
            "type": "string",
            "description": "How an image meets the width and height. Cover and pad need both, and make every image that size, as a shop's square product photos.",
            "default": "inside"
          },
          "minSide": {
            "title": "Skip images smaller than",
            "minimum": 1,
            "type": "integer",
            "description": "Images whose width or height is under this, as icons and tracking pixels, are left out and not charged."
          },
          "background": {
            "title": "Background",
            "type": "string",
            "description": "What transparent parts become in a JPEG, which has no transparency, and the margins of Fit pad: a colour such as #ffffff or black.",
            "default": "#ffffff"
          },
          "zip": {
            "title": "ZIP of all files",
            "type": "boolean",
            "description": "Also puts every converted file in one images.zip, up to 300 MB, at no extra cost.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}