{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Converter Pro: Target Size, Crop, Dataset Input",
    "description": "Convert AVIF, JPG, PNG, WebP, GIF, BMP or TIFF to JPG, PNG, WebP or AVIF. Hit a target file size in KB, crop to fill or pad to an exact size, grayscale, ZIP. Reads URLs, dataset fields or key-value store images. Empty input = free demo.",
    "version": "0.1",
    "x-build-id": "139H587ciutQBfgop"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ucchiii~image-converter-pro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ucchiii-image-converter-pro",
        "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/ucchiii~image-converter-pro/runs": {
      "post": {
        "operationId": "runs-sync-ucchiii-image-converter-pro",
        "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/ucchiii~image-converter-pro/run-sync": {
      "post": {
        "operationId": "run-sync-ucchiii-image-converter-pro",
        "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": "Public http(s) links to JPG, PNG, WebP, GIF, BMP, TIFF or AVIF images, one per line. Up to 1,000 images per run in total (URLs + dataset + key-value store), 25 MB and 50 megapixels each. Leave all image inputs empty for a free demo on built-in sample images.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset with image URLs",
            "type": "string",
            "description": "Optional. ID of a dataset (for example a scraper run's 'defaultDatasetId') whose items contain image URLs. They are added after the list above."
          },
          "urlField": {
            "title": "URL field in dataset",
            "type": "string",
            "description": "Field of each dataset item that holds the image URL. Use dots for nested fields, e.g. 'product.image' or 'images.0'. A list of URLs (e.g. 'imageUrls') is read in full. Default 'url'.",
            "default": "url"
          },
          "keyValueStoreId": {
            "title": "Key-value store with images",
            "type": "string",
            "description": "Optional. ID of a key-value store that already holds image files (for example from a downloader run). Every binary record is converted; JSON and text records such as INPUT are skipped."
          },
          "keyPrefix": {
            "title": "Only keys starting with",
            "type": "string",
            "description": "Optional. Convert only key-value store records whose key starts with this text, e.g. 'photo-'."
          },
          "outputFormat": {
            "title": "Convert to",
            "enum": [
              "webp",
              "jpg",
              "png",
              "avif"
            ],
            "type": "string",
            "description": "Output format. Transparent areas become the background color in JPG.",
            "default": "webp"
          },
          "quality": {
            "title": "Quality (JPG, WebP, AVIF)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "1-100. Default 85. Lower = smaller files. With a target size this is the highest quality tried. PNG is always lossless and ignores this.",
            "default": 85
          },
          "targetKb": {
            "title": "Target file size (KB)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Optional, for JPG, WebP and AVIF. Each file is made at most this many kilobytes (1 KB = 1,024 bytes): the highest quality that fits is searched, and if even the minimum quality is too big the image is shrunk in steps. If it still cannot fit, the smallest result is saved with a note."
          },
          "minQuality": {
            "title": "Minimum quality for target size",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "With a target size, quality is not lowered below this; the image is shrunk instead. Default 30.",
            "default": 30
          },
          "width": {
            "title": "Width (px)",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Optional. Box width. With 'inside' it is a maximum; with 'cover' and 'contain' it is the exact output width."
          },
          "height": {
            "title": "Height (px)",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Optional. Box height. With 'inside' it is a maximum; with 'cover' and 'contain' it is the exact output height."
          },
          "fit": {
            "title": "Resize mode",
            "enum": [
              "inside",
              "cover",
              "contain"
            ],
            "type": "string",
            "description": "How width and height are used. Cover and contain need both width and height.",
            "default": "inside"
          },
          "allowUpscale": {
            "title": "Allow enlarging small images",
            "type": "boolean",
            "description": "Off (default): images are only made smaller. On: smaller images are enlarged to the box.",
            "default": false
          },
          "background": {
            "title": "Background color",
            "type": "string",
            "description": "Hex color for transparent areas in JPG and for the padding in 'contain' mode. Default #FFFFFF (white).",
            "default": "#FFFFFF"
          },
          "grayscale": {
            "title": "Grayscale",
            "type": "boolean",
            "description": "Convert images to black and white.",
            "default": false
          },
          "autoRotate": {
            "title": "Auto-rotate from EXIF",
            "type": "boolean",
            "description": "Turn photos upright using the camera's orientation tag (EXIF). Default on.",
            "default": true
          },
          "stripMetadata": {
            "title": "Remove metadata",
            "type": "boolean",
            "description": "Default on: EXIF data such as camera details, date and GPS location is not copied into the output. Off: EXIF is kept. The RGB color profile is always kept so colors look the same.",
            "default": true
          },
          "zipOutput": {
            "title": "Also create a ZIP",
            "type": "boolean",
            "description": "Also put all converted files into one ZIP (key 'images.zip'; its link is in the STATS record and the run's output tab). Up to 300 MB in total. No extra charge.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}