{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Converter and Compressor: WebP, AVIF, JPEG, PNG, Resize",
    "description": "Convert, compress and resize images in bulk: JPEG, PNG, WebP, AVIF, GIF and TIFF output, HEIC input, quality, maximum size and dimensions, EXIF and GPS removal. Images you provide only, nothing else is collected. Not found, blocked and non-image inputs are free.",
    "version": "0.1",
    "x-build-id": "0RwBCkYUgUkc22vsr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/greenrun~image-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-greenrun-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/greenrun~image-converter/runs": {
      "post": {
        "operationId": "runs-sync-greenrun-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/greenrun~image-converter/run-sync": {
      "post": {
        "operationId": "run-sync-greenrun-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 URLs",
            "type": "array",
            "description": "Public http or https links to images (JPEG, PNG, WebP, AVIF, HEIC, GIF, TIFF, BMP), one per line. data:image/...;base64 URIs work too. Each image becomes one row; the index field keeps the input order.",
            "items": {
              "type": "string"
            }
          },
          "format": {
            "title": "Output format",
            "enum": [
              "webp",
              "jpeg",
              "png",
              "avif",
              "gif",
              "tiff"
            ],
            "type": "string",
            "description": "WebP and AVIF give the smallest files for the web (AVIF is smaller but slower and priced as 'image-avif'). JPEG for compatibility, PNG and TIFF lossless, GIF for simple animations.",
            "default": "webp"
          },
          "quality": {
            "title": "Quality (1-100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "For JPEG, WebP and AVIF. Leave empty for the format's default: JPEG 85, WebP 80, AVIF 60. Lower means smaller files."
          },
          "maxWidth": {
            "title": "Max width (px)",
            "minimum": 0,
            "maximum": 65535,
            "type": "integer",
            "description": "Larger images are scaled down to fit, keeping the aspect ratio; smaller ones are never enlarged. 0 keeps the width.",
            "default": 0
          },
          "maxHeight": {
            "title": "Max height (px)",
            "minimum": 0,
            "maximum": 65535,
            "type": "integer",
            "description": "Larger images are scaled down to fit, keeping the aspect ratio. 0 keeps the height.",
            "default": 0
          },
          "maxFileSizeKb": {
            "title": "Max file size (KB)",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Target size of each result, in kilobytes (1 KB = 1,000 bytes). JPEG, WebP and AVIF lower the quality first (down to 40), then the dimensions; PNG, GIF and TIFF lower only the dimensions. 0 means no target.",
            "default": 0
          },
          "metadata": {
            "title": "Metadata (EXIF, GPS)",
            "enum": [
              "remove",
              "removeGps",
              "keep"
            ],
            "type": "string",
            "description": "Remove all: EXIF, GPS location, XMP and comments are removed (the colour profile stays). Keep EXIF without GPS: camera and date stay, location goes. Keep: EXIF and XMP as they are. The rotation from EXIF is always applied to the pixels.",
            "default": "remove"
          },
          "lossless": {
            "title": "Lossless WebP",
            "type": "boolean",
            "description": "WebP without any quality loss, good for screenshots, logos and graphics; photos get much larger. PNG, GIF and TIFF are always lossless.",
            "default": false
          },
          "keepAnimation": {
            "title": "Keep animation",
            "type": "boolean",
            "description": "Animated GIF, WebP, PNG (APNG) and AVIF stay animated when the output is WebP or GIF. Other outputs, or this switch off, take the first frame.",
            "default": true
          },
          "backgroundColor": {
            "title": "Background for transparency (JPEG)",
            "pattern": "^#?[0-9a-fA-F]{6}$",
            "type": "string",
            "description": "JPEG has no transparency: transparent areas are filled with this colour, as #rrggbb.",
            "default": "#ffffff"
          },
          "zip": {
            "title": "Also create one ZIP",
            "type": "boolean",
            "description": "Pack every converted image into images.zip in the key-value store, with manifest.csv. The ZIP itself is free.",
            "default": false
          },
          "keyValueStoreId": {
            "title": "Images from a key-value store (optional)",
            "type": "string",
            "description": "Also convert the images stored in this key-value store, for example files you uploaded or the output of another Actor. JSON and text records are skipped."
          },
          "keyPrefix": {
            "title": "Only keys starting with",
            "type": "string",
            "description": "Convert only the records of the key-value store whose key starts with this text. Empty: all records."
          },
          "datasetId": {
            "title": "Image URLs from a dataset (optional)",
            "type": "string",
            "description": "Also convert the image links found in this dataset, for example the output of a scraper. Pick the field below."
          },
          "datasetField": {
            "title": "Dataset field with the links",
            "type": "string",
            "description": "Field of each dataset item that holds the image link. Dot paths and lists work: url, images, images.url, product.imageUrl.",
            "default": "url"
          },
          "maxInputSizeMb": {
            "title": "Max input file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger images are skipped for free.",
            "default": 50
          },
          "maxConcurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many images are downloaded at the same time. Conversion uses one CPU core per 4 GB of memory.",
            "default": 4
          },
          "timeoutSecs": {
            "title": "Download timeout per image (seconds)",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "A download that takes longer fails for free. A download also stops when waiting longer would cost more than its image pays: after about 21 s at 1 GB of memory (115 s for AVIF), less with more memory.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}