{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Compare – Similarity, Visual Diff & Duplicate Finder",
    "description": "Compare images in bulk: similarity score, SSIM, pHash, pixel difference % and a visual diff PNG. One image against many, before/after pairs, all pairs, or group duplicate images in a list or dataset. No AI model, no API key. $0.30 per 1,000 comparisons.",
    "version": "0.1",
    "x-build-id": "q6nqZf4t6ViPZtDmQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~image-compare/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-image-compare",
        "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/gazidev~image-compare/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-image-compare",
        "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/gazidev~image-compare/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-image-compare",
        "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": {
          "mode": {
            "title": "What to compare",
            "enum": [
              "auto",
              "one-to-many",
              "pairs",
              "all-pairs",
              "duplicates"
            ],
            "type": "string",
            "description": "Automatic: `pairs` filled = pairs; `sourceImage` filled = one-to-many; exactly 2 images = one pair; otherwise duplicates. One-to-many, pairs and all-pairs cost one comparison per pair. Duplicates costs one comparison per image, not per pair.",
            "default": "auto"
          },
          "sourceImage": {
            "title": "Source image",
            "type": "string",
            "description": "Image that is compared with every image in the list below (one-to-many). Direct link, `data:image/...;base64` URI or a built-in `sample://` image. Replace or clear the sample when you use your own images."
          },
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Direct links to JPG, PNG, WebP, AVIF, HEIC/HEIF, TIFF, GIF or BMP files. `data:image/...;base64` URIs work too. The `sample://` values are small demo images inside the Actor.",
            "items": {
              "type": "string"
            }
          },
          "pairs": {
            "title": "Image pairs",
            "type": "array",
            "description": "List of pairs: `[{\"a\": \"https://...\", \"b\": \"https://...\", \"label\": \"home page\"}]`. `before`/`after`, `imageA`/`imageB` and two-element arrays are accepted. Two file links per pair."
          },
          "bulkText": {
            "title": "Bulk list (paste text or CSV)",
            "type": "string",
            "description": "One URL per line, or a CSV with a `url` / `image` column. In mode 'pairs': two URLs per line."
          },
          "sourceFileUrl": {
            "title": "Load URLs from a file (URL)",
            "type": "string",
            "description": "Public .txt or .csv link (Google Sheets 'Publish to web, CSV' works), up to 5 MB. Same format as the bulk list."
          },
          "datasetId": {
            "title": "Read images from an Apify dataset",
            "type": "string",
            "description": "Chain after a scraper (for example product images)."
          },
          "datasetField": {
            "title": "Dataset field with the image URL",
            "type": "string",
            "description": "Dot paths such as `images.0` and arrays of URLs are accepted. In mode 'pairs' this is image A.",
            "default": "url"
          },
          "datasetFieldB": {
            "title": "Dataset field with the second image (pairs)",
            "type": "string",
            "description": "When set, each dataset item is one pair: image A from the field above, image B from this field (mode 'pairs' or automatic)."
          },
          "matchThreshold": {
            "title": "Match threshold (pHash distance, 0-24)",
            "minimum": 0,
            "maximum": 24,
            "type": "integer",
            "description": "Images count as similar or duplicate when their 64-bit perceptual hashes differ in at most this many bits. 0-4 strict (re-encoded or resized copies), 8 normal, 12+ loose (more false matches).",
            "default": 8
          },
          "colorSensitive": {
            "title": "Colours must match too",
            "type": "boolean",
            "description": "Perceptual hashes ignore colour. Keep this on so that a red and a blue version of the same product are not called duplicates.",
            "default": true
          },
          "detectRotations": {
            "title": "Find rotated and mirrored copies",
            "type": "boolean",
            "description": "Also tests image B rotated by 90, 180 and 270 degrees and mirrored. `bestTransform` shows which one matches.",
            "default": false
          },
          "pixelThreshold": {
            "title": "Pixel tolerance (0-254)",
            "minimum": 0,
            "maximum": 254,
            "type": "integer",
            "description": "A pixel counts as changed when any colour channel differs by more than this. 0 = every difference, 25 ignores JPEG noise.",
            "default": 25
          },
          "compareSize": {
            "title": "Compare size (longest side, px)",
            "minimum": 128,
            "maximum": 4096,
            "type": "integer",
            "description": "Images are reduced to this size before SSIM and pixel difference (never enlarged). Use 2048-4096 for full-page screenshots with small text; it is slower.",
            "default": 1024
          },
          "createDiffImages": {
            "title": "Create diff images (PNG)",
            "type": "boolean",
            "description": "Stores a picture of the differences for every pair that is not identical ($0.001 each). Not used in mode 'duplicates'.",
            "default": false
          },
          "diffStyle": {
            "title": "Diff style",
            "enum": [
              "highlight",
              "heatmap",
              "side-by-side"
            ],
            "type": "string",
            "description": "How differences are drawn.",
            "default": "highlight"
          },
          "maxDiffImages": {
            "title": "Maximum diff images",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Spending guard for diff images.",
            "default": 100
          },
          "maxComparisons": {
            "title": "Maximum comparisons",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Spending guard for pairs (all pairs of 100 images are 4,950 comparisons).",
            "default": 1000
          },
          "maxImages": {
            "title": "Maximum images from the list",
            "minimum": 2,
            "maximum": 20000,
            "type": "integer",
            "description": "Images above this number are skipped. All-pairs mode always stops at 200 images.",
            "default": 1000
          },
          "maxFileSizeMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Larger files are reported as TOO_LARGE (free).",
            "default": 20
          },
          "maxMegapixels": {
            "title": "Maximum image size (megapixels)",
            "minimum": 1,
            "maximum": 80,
            "type": "integer",
            "description": "Protects against decompression bombs. With 512 MB of memory: JPG up to about 50 MP, other formats about 25 MP. Larger images are reported for free; run with 1024 MB for them.",
            "default": 40
          },
          "maxConcurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Lower this if the image host limits requests.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}