{
  "openapi": "3.0.1",
  "info": {
    "title": "Bulk Image Converter: WebP, AVIF, Resize [USD 1/1K]",
    "description": "Convert images in bulk to WebP, AVIF, JPEG or PNG from links, a dataset or stored files. Resize, set quality or a target file size, strip metadata; SVG, GIF, TIFF, BMP and AVIF in. USD 1 per 1,000 images, plus USD 0.0001 per extra megapixel and 0.0002 per extra MB.",
    "version": "1.0",
    "x-build-id": "orWQSy8BTWjncXlft"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/usefulapi~bulk-image-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-usefulapi-bulk-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/usefulapi~bulk-image-converter/runs": {
      "post": {
        "operationId": "runs-sync-usefulapi-bulk-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/usefulapi~bulk-image-converter/run-sync": {
      "post": {
        "operationId": "run-sync-usefulapi-bulk-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 links",
            "type": "array",
            "description": "One link per line to an image file (JPEG, PNG, WebP, AVIF, GIF, TIFF, BMP, SVG). Links are downloaded as given (no page is read, no robots.txt), on ports 80, 443, 8080 and 8443 only. The format is read from the file's bytes, not its extension. Up to 20,000 inputs per run.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset with image links (optional)",
            "type": "string",
            "description": "ID of a dataset of yours with one image link per item, for example the dataset of the Bulk Image Downloader Actor. The link is taken from the field below, or from the first of fileUrl, imageUrl, url, image, src, link that holds a link."
          },
          "datasetUrlField": {
            "title": "Link field in the dataset (optional)",
            "type": "string",
            "description": "Name of the field that holds the image link, e.g. fileUrl or photo.src. Empty = automatic."
          },
          "keyValueStoreId": {
            "title": "Key-value store with images (optional)",
            "type": "string",
            "description": "ID of a key-value store of yours whose records are images. Every record is converted (INPUT, OUTPUT and STATE are skipped when no prefix is set)."
          },
          "keyPrefix": {
            "title": "Only records starting with (optional)",
            "type": "string",
            "description": "Convert only the records whose key starts with this text."
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "webp",
              "avif",
              "jpeg",
              "png"
            ],
            "type": "string",
            "description": "Every image is converted to this format.",
            "default": "webp"
          },
          "quality": {
            "title": "Quality (1 to 100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Empty = 80 for WebP and JPEG, 60 for AVIF. PNG is lossless unless you turn on the palette option. Ignored when Lossless is on."
          },
          "lossless": {
            "title": "Lossless (WebP and AVIF)",
            "type": "boolean",
            "description": "Lossless WebP or AVIF: no quality loss, larger files.",
            "default": false
          },
          "pngPalette": {
            "title": "PNG: reduce to 256 colours",
            "type": "boolean",
            "description": "Smaller PNG files by quantising to a palette of 256 colours (lossy); the quality setting then controls the loss. Off: PNG output is lossless, greyscale stays greyscale and 16-bit stays 16-bit.",
            "default": false
          },
          "avifEffort": {
            "title": "AVIF effort (0 to 2)",
            "minimum": 0,
            "maximum": 2,
            "type": "integer",
            "description": "Higher is smaller and slower. Limited to 2: on Apify's servers effort 3 took about 45 s for a 4.6 megapixel image where effort 2 took 2 s. The price is the same for every value.",
            "default": 2
          },
          "maxWidth": {
            "title": "Max width (px)",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Empty = keep the size."
          },
          "maxHeight": {
            "title": "Max height (px)",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Empty = keep the size."
          },
          "fit": {
            "title": "Resize fit",
            "enum": [
              "inside",
              "outside",
              "cover",
              "contain",
              "fill"
            ],
            "type": "string",
            "description": "How an image is fitted into Max width and Max height. Inside never crops.",
            "default": "inside"
          },
          "allowEnlargement": {
            "title": "Allow enlarging small images",
            "type": "boolean",
            "description": "Off: an image smaller than the box keeps its size.",
            "default": false
          },
          "stripMetadata": {
            "title": "Strip metadata",
            "type": "boolean",
            "description": "Removes EXIF (camera, GPS), XMP and colour profile. Turn off to keep them.",
            "default": true
          },
          "autoRotate": {
            "title": "Apply EXIF rotation",
            "type": "boolean",
            "description": "Turns photos upright from their EXIF orientation.",
            "default": true
          },
          "background": {
            "title": "Background colour",
            "type": "string",
            "description": "Fills transparency when converting to JPEG, and padding for the contain fit. Format #rgb or #rrggbb.",
            "default": "#ffffff"
          },
          "targetMaxKb": {
            "title": "Target max file size (KB)",
            "minimum": 1,
            "type": "integer",
            "description": "The quality is searched (best first) so the file is at or under this size. Works with lossy output only (JPEG, WebP, AVIF, PNG with palette). Every extra encoding pass is billed as megapixels. If it cannot be reached, the row says so."
          },
          "targetMaxTries": {
            "title": "Target size: max encodings",
            "minimum": 2,
            "maximum": 8,
            "type": "integer",
            "description": "At most this many encodings per image while searching for the target size (the first one included).",
            "default": 6
          },
          "animation": {
            "title": "Animated GIF",
            "enum": [
              "keep",
              "first-frame"
            ],
            "type": "string",
            "description": "Only WebP can keep an animation here; JPEG, PNG and AVIF output always use the first frame (the row says how many frames were dropped).",
            "default": "keep"
          },
          "svgScale": {
            "title": "SVG scale",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "SVG files are drawn at this multiple of their own size when you set no max width or height (never above 4096 px). The megapixels are billed on the size the SVG is drawn at.",
            "default": 2
          },
          "maxFileSizeMb": {
            "title": "Max input file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger files are not downloaded (cheap row). Hard limit 100 MB.",
            "default": 25
          },
          "maxMegapixels": {
            "title": "Max megapixels",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Images with more pixels (all frames of an animation) are refused. The run's memory limits AVIF output to about 50 megapixels and other formats to about 90.",
            "default": 50
          },
          "timeoutSecs": {
            "title": "Longest time per image (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Ceiling for one conversion. The time a conversion may take is a 5 s allowance plus what its megapixel events pay for (about 0.7 s per megapixel and 1.4 s more per AVIF megapixel), so a large image gets the time it needs, up to this ceiling. A conversion over its time is stopped and the row says so.",
            "default": 120
          },
          "retries": {
            "title": "Download retries",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Retries of a download that failed for a reason a retry can fix (no answer, too slow, server error). In a very small run a slow failed download may not be retried: each retry is reserved against what the run has earned first.",
            "default": 1
          },
          "concurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Images downloaded at the same time (conversion has its own limit set by the run's memory).",
            "default": 10
          },
          "maxInputs": {
            "title": "Max inputs",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "The run stops reading inputs after this many.",
            "default": 20000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}