{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Compressor & Converter - Batch WebP, AVIF, JPEG, PNG",
    "description": "Bulk compress, resize and convert images to WebP, AVIF, JPEG or PNG. Get files one by one or as a ZIP. Pay only per image processed.",
    "version": "0.1",
    "x-build-id": "ia94ownyjLvQRTqI2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rinveta~image-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rinveta-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/rinveta~image-converter/runs": {
      "post": {
        "operationId": "runs-sync-rinveta-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/rinveta~image-converter/run-sync": {
      "post": {
        "operationId": "run-sync-rinveta-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": {
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct links to the images you want to compress or convert (JPEG, PNG, WebP, AVIF, GIF, TIFF, HEIC, SVG). Only the URLs you list here are downloaded.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "inputDatasetId": {
            "title": "Input dataset ID (optional)",
            "type": "string",
            "description": "ID or name of a dataset (for example the output of another Actor) whose items contain an image URL."
          },
          "datasetUrlField": {
            "title": "Dataset field with the image URL",
            "type": "string",
            "description": "Name of the dataset field that contains the image URL.",
            "default": "url"
          },
          "inputKeyValueStoreId": {
            "title": "Input key-value store ID (optional)",
            "type": "string",
            "description": "ID or name of a key-value store holding your own image files. Every record whose key ends with an image extension is processed."
          },
          "keyPrefix": {
            "title": "Key prefix filter",
            "type": "string",
            "description": "Only process records whose key starts with this prefix (key-value store input)."
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "webp",
              "avif",
              "jpeg",
              "png",
              "original"
            ],
            "type": "string",
            "description": "Target format. 'original' keeps each image in its own format (JPEG, PNG, WebP, AVIF) and only recompresses it.",
            "default": "webp"
          },
          "quality": {
            "title": "Quality (1-100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Compression quality for WebP, AVIF, JPEG and palette PNG. 75-85 is visually lossless for most photos.",
            "default": 80
          },
          "lossless": {
            "title": "Lossless (WebP/AVIF)",
            "type": "boolean",
            "description": "Encode WebP/AVIF without quality loss. Larger files.",
            "default": false
          },
          "avifEffort": {
            "title": "AVIF effort (0-9)",
            "minimum": 0,
            "maximum": 9,
            "type": "integer",
            "description": "CPU effort for AVIF. 2 is fast with files ~10% larger than effort 4, which is about 8x slower.",
            "default": 2
          },
          "pngPalette": {
            "title": "PNG palette (8-bit) compression",
            "type": "boolean",
            "description": "Reduce PNG to a quantized palette using the quality setting. Much smaller files, slight color loss.",
            "default": false
          },
          "maxWidth": {
            "title": "Max width (px)",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Resize so the width does not exceed this value. Leave empty for no limit."
          },
          "maxHeight": {
            "title": "Max height (px)",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Resize so the height does not exceed this value. Leave empty for no limit."
          },
          "fit": {
            "title": "Resize mode",
            "enum": [
              "inside",
              "cover",
              "contain",
              "fill",
              "outside"
            ],
            "type": "string",
            "description": "How the image fits in the max width/height box.",
            "default": "inside"
          },
          "withoutEnlargement": {
            "title": "Never upscale",
            "type": "boolean",
            "description": "Do not enlarge images smaller than the target size.",
            "default": true
          },
          "backgroundColor": {
            "title": "Background color",
            "type": "string",
            "description": "Used to fill transparency when converting to JPEG and for 'contain' resizing.",
            "default": "#ffffff"
          },
          "autoRotate": {
            "title": "Auto-rotate by EXIF",
            "type": "boolean",
            "description": "Apply the EXIF orientation so photos are upright after metadata is removed.",
            "default": true
          },
          "keepMetadata": {
            "title": "Keep metadata (EXIF, ICC)",
            "type": "boolean",
            "description": "Off by default: metadata (including GPS position) is stripped, which also reduces size.",
            "default": false
          },
          "keepOriginalIfLarger": {
            "title": "Keep original if result is larger",
            "type": "boolean",
            "description": "If recompression would not make an image smaller (and no resize was applied) the original file is returned unchanged.",
            "default": true
          },
          "createZip": {
            "title": "Create ZIP archive",
            "type": "boolean",
            "description": "Also save all results as images.zip in the key-value store.",
            "default": true
          },
          "maxImages": {
            "title": "Max images per run",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Safety limit on the number of images processed in one run.",
            "default": 1000
          },
          "maxImageSizeMB": {
            "title": "Max size per image (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Larger images are skipped with an error.",
            "default": 30
          },
          "concurrency": {
            "title": "Parallel images",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many images are processed at the same time. Increase together with the run memory.",
            "default": 4
          },
          "downloadTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Maximum time to wait for each image download before it is reported as failed.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}