{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk Image Downloader & Optimizer: Resize, WebP, EXIF",
    "description": "Download direct image URLs or uploads, resize, convert to WebP/AVIF/JPEG/PNG, strip metadata, SHA-256 and perceptual hash. $2 per 1,000 images.",
    "version": "0.1",
    "x-build-id": "Ggny3U80RROGcyN6q"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ataism~image-optimizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ataism-image-optimizer",
        "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/ataism~image-optimizer/runs": {
      "post": {
        "operationId": "runs-sync-ataism-image-optimizer",
        "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/ataism~image-optimizer/run-sync": {
      "post": {
        "operationId": "run-sync-ataism-image-optimizer",
        "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 http(s) links to image files (JPEG, PNG, WebP, GIF, AVIF, TIFF), one per line. Web pages are not crawled. Private, local and internal addresses are blocked, and so are social-media and platform hosts. robots.txt of each host is checked. To use a file from your computer, upload it with the next field, or save it to a key-value store and paste its record URL here.",
            "items": {
              "type": "string"
            }
          },
          "imageFiles": {
            "title": "Uploaded image files",
            "type": "array",
            "description": "Upload images from your computer to a key-value store of your choice (the editor offers this), or paste a record URL. The Actor reads each file once and saves the optimized copy in this run's key-value store."
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "webp",
              "avif",
              "jpeg",
              "png",
              "original"
            ],
            "type": "string",
            "description": "WebP and AVIF are smallest. JPEG and PNG are the most compatible. \"Same as input\" keeps each file's own format (GIF stays GIF, TIFF stays TIFF). Animated GIF and WebP stay animated when the output is WebP or GIF and the frames total at most 16 megapixels; otherwise only the first frame is kept.",
            "default": "webp"
          },
          "quality": {
            "title": "Quality (1-100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Compression quality for WebP, AVIF and JPEG. 80 is a good balance. PNG is always lossless, so this does not apply to it.",
            "default": 80
          },
          "maxWidth": {
            "title": "Max width (px)",
            "minimum": 0,
            "maximum": 16384,
            "type": "integer",
            "description": "Resize so the image is at most this wide, keeping the aspect ratio. Images are never enlarged. 0 = no limit.",
            "default": 0
          },
          "maxHeight": {
            "title": "Max height (px)",
            "minimum": 0,
            "maximum": 16384,
            "type": "integer",
            "description": "Resize so the image is at most this tall, keeping the aspect ratio ('fit inside' together with max width). Never enlarged. 0 = no limit.",
            "default": 0
          },
          "keepMetadata": {
            "title": "Keep metadata",
            "type": "boolean",
            "description": "Off (default): all metadata is removed from the saved image. On: keeps the colour profile and these EXIF fields: camera make, model and capture date. GPS location, comments, XMP and thumbnails are always removed, even when this is on.",
            "default": false
          },
          "includeExif": {
            "title": "Return EXIF details",
            "type": "boolean",
            "description": "Adds an \"exif\" object to each row with camera make, camera model, capture date and orientation. GPS location is never returned, even if you ask; the row only says whether it was present and removed (\"gpsRemoved\").",
            "default": false
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Larger files are skipped with an error and not charged. Default 25, maximum 50. Images above 64 megapixels are skipped too. Big files (above 5 MB, or above 16 megapixels) and big saved outputs (above 5 MB, for example full-size PNG) add the large-image event (see Pricing).",
            "default": 25
          },
          "allowSlowHosts": {
            "title": "Allow slow hosts",
            "type": "boolean",
            "description": "Off: images on a host whose robots.txt asks for a Crawl-delay over 2 seconds are skipped (free \"slow-host\" rows), because waiting between downloads makes the run slow and the compute cost can exceed the image price. On: images on hosts with a delay of 2 to 3.5 seconds are downloaded and the delay is honoured in full between every request to that host, so the run takes longer and the waiting is billed as run time (a 3.5 second delay costs about 9.7% of the image price in compute at $0.20 per compute unit). Hosts that ask for more than 3.5 seconds are still skipped. Default off.",
            "default": false
          },
          "downloadTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Per image, including redirects. Time spent waiting for a Crawl-delay is not counted.",
            "default": 60
          },
          "mode": {
            "title": "Mode",
            "type": "string",
            "description": "Internal: \"selfTest\" runs the maintainer health check and saves no items.",
            "default": "run"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}