{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Converter: Resize, Compress, WebP and AVIF",
    "description": "Convert, resize and compress images in bulk. JPEG, PNG, WebP, AVIF, GIF, TIFF and SVG in, WebP, AVIF, JPEG, PNG, GIF or TIFF out. Thumbnails and responsive sizes in one run, metadata stripped, EXIF rotation applied. Files land in the key-value store. Pay per produced file.",
    "version": "0.1",
    "x-build-id": "24l6FlnzNnVQ9CCcs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/forgeloop~image-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-forgeloop-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/forgeloop~image-converter/runs": {
      "post": {
        "operationId": "runs-sync-forgeloop-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/forgeloop~image-converter/run-sync": {
      "post": {
        "operationId": "run-sync-forgeloop-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": {
          "images": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct http(s) links to image files you are allowed to use: JPEG, PNG, WebP, AVIF, GIF, TIFF or SVG. Links to records in your Apify key-value stores (https://api.apify.com/v2/key-value-stores/.../records/...) work too. Links to video, social media and photo sharing platforms (YouTube, Instagram, TikTok, Pinterest, Flickr and the like) are refused. Format: a list of strings like [\"https://example.com/photo.jpg\"].",
            "items": {
              "type": "string"
            }
          },
          "base64Images": {
            "title": "Base64 images",
            "type": "array",
            "description": "Optional. Images as base64 inside the input, for small files from automations. A JSON array of objects like [{\"name\": \"logo.png\", \"data\": \"iVBORw0KGgo...\"}]. data can also be a data URI (data:image/png;base64,...). The Apify input is limited to a few MB in total, so use Image URLs for large files."
          },
          "format": {
            "title": "Output format",
            "enum": [
              "webp",
              "avif",
              "jpeg",
              "png",
              "gif",
              "tiff",
              "original"
            ],
            "type": "string",
            "description": "Format of the produced files. WebP and AVIF give the smallest files and work in all current browsers. \"original\" keeps the format of each source image (SVG becomes PNG). GIF output is a single frame.",
            "default": "webp"
          },
          "width": {
            "title": "Width (px)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Target width in pixels. Leave empty to keep the width or to follow the height with the same aspect ratio."
          },
          "height": {
            "title": "Height (px)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Target height in pixels. Leave empty to keep the height or to follow the width with the same aspect ratio."
          },
          "fit": {
            "title": "Fit",
            "enum": [
              "inside",
              "cover",
              "contain",
              "outside",
              "fill"
            ],
            "type": "string",
            "description": "How the image fits into width x height when both are set. inside: as large as possible within the box, aspect ratio kept, no crop. cover: fills the box and crops the rest. contain: fits into the box and pads with the background color. outside: at least as large as the box. fill: stretches to the exact size.",
            "default": "inside"
          },
          "position": {
            "title": "Crop position",
            "enum": [
              "centre",
              "top",
              "right",
              "bottom",
              "left",
              "left top",
              "right top",
              "left bottom",
              "right bottom",
              "entropy",
              "attention"
            ],
            "type": "string",
            "description": "Which part to keep when fit is cover, or where to place the image when fit is contain. entropy and attention pick the most detailed or most striking region (cover only).",
            "default": "centre"
          },
          "withoutEnlargement": {
            "title": "Do not enlarge",
            "type": "boolean",
            "description": "Never make an image larger than the source. A 600 px wide image stays 600 px when you ask for 1600 px.",
            "default": true
          },
          "quality": {
            "title": "Quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "1 to 100 for WebP, AVIF and JPEG, and for PNG with palette. Lower means smaller files. 75 to 85 looks good for photos on the web.",
            "default": 80
          },
          "lossless": {
            "title": "Lossless (WebP, AVIF)",
            "type": "boolean",
            "description": "Encode WebP and AVIF without any quality loss. Good for logos, screenshots and graphics. Files are larger than lossy ones. PNG, GIF and TIFF are always lossless, JPEG never.",
            "default": false
          },
          "variants": {
            "title": "Variants",
            "type": "array",
            "description": "Optional. Several outputs per image in one run, for example thumbnails and responsive sizes. A JSON array of up to 10 objects. Each object can set label, width, height, format, quality, fit, position, lossless, withoutEnlargement, grayscale and flatten. Missing fields come from the settings above. Example: [{\"label\": \"thumb\", \"width\": 200}, {\"label\": \"medium\", \"width\": 800}, {\"label\": \"large\", \"width\": 1600, \"format\": \"avif\"}]. Each produced file is one charged item."
          },
          "stripMetadata": {
            "title": "Strip metadata",
            "type": "boolean",
            "description": "Remove EXIF (camera, GPS location, date), XMP and the color profile. Colors are converted to sRGB first. Turn it off to keep the metadata.",
            "default": true
          },
          "autoRotate": {
            "title": "Apply EXIF orientation",
            "type": "boolean",
            "description": "Rotate photos the way the camera recorded them (EXIF orientation), so they look upright everywhere. Turn it off only if you know why.",
            "default": true
          },
          "background": {
            "title": "Background color",
            "type": "string",
            "description": "Fills transparent areas when the output has no transparency (JPEG) or when Flatten is on, and pads the image when fit is contain. Hex like \"#ffffff\", rgb(255,255,255) or a name like \"white\" or \"transparent\".",
            "default": "#ffffff"
          },
          "flatten": {
            "title": "Flatten transparency",
            "type": "boolean",
            "description": "Replace transparency with the background color for every output format, not only JPEG.",
            "default": false
          },
          "grayscale": {
            "title": "Grayscale",
            "type": "boolean",
            "description": "Convert to black and white.",
            "default": false
          },
          "pngPalette": {
            "title": "PNG with palette (smaller)",
            "type": "boolean",
            "description": "Reduce PNG output to at most 256 colors with dithering, like TinyPNG. Often 60 to 80 percent smaller. Quality controls how many colors are kept. Off: full color PNG.",
            "default": false
          },
          "includeBase64": {
            "title": "Include base64 in the output",
            "type": "boolean",
            "description": "Add the produced file as base64 to each dataset item, for automations that cannot download files. Only for files under 1 MB, larger files get a note instead.",
            "default": false
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Larger source images are skipped with an error item and are not charged. At most 25 MB. Images above 100 megapixels are skipped too.",
            "default": 25
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many images are downloaded and converted at the same time. Higher is faster for many small images. Lower it if large images run out of memory.",
            "default": 4
          },
          "downloadTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Give up on a download that takes longer than this. The image gets a free error item.",
            "default": 60
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}