{
  "openapi": "3.0.1",
  "info": {
    "title": "Near-Duplicate Content Finder (MinHash + SimHash)",
    "description": "Find duplicate and near-duplicate pages and texts at scale. Fetches URLs, strips boilerplate, clusters similar content with MinHash LSH and SimHash, and flags the canonical version. No external APIs.",
    "version": "1.0",
    "x-build-id": "JkkQYc9436NcDWUvg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/freecamp008~near-duplicate-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-freecamp008-near-duplicate-finder",
        "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/freecamp008~near-duplicate-finder/runs": {
      "post": {
        "operationId": "runs-sync-freecamp008-near-duplicate-finder",
        "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/freecamp008~near-duplicate-finder/run-sync": {
      "post": {
        "operationId": "run-sync-freecamp008-near-duplicate-finder",
        "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": "URLs",
            "type": "array",
            "description": "Web pages to compare. The main content is extracted (navigation, header, footer, scripts, styles and asides are removed; <code>&lt;article&gt;</code> / <code>&lt;main&gt;</code> are preferred). Each page becomes one result.",
            "items": {
              "type": "string"
            }
          },
          "texts": {
            "title": "Texts",
            "type": "array",
            "description": "Raw texts to compare (with each other and with the URLs). Either plain strings or objects <code>{\"id\": \"sku-1\", \"text\": \"...\"}</code>. Each text becomes one result."
          },
          "datasetId": {
            "title": "Dataset with documents",
            "type": "string",
            "description": "Optional: compare the items of an existing dataset (e.g. the output of Website Content Crawler or any scraper). Best for large corpora (10k-50k+ documents) that are too big to paste as input. Set the field names below."
          },
          "datasetTextField": {
            "title": "Dataset text field",
            "type": "string",
            "description": "Field holding the document text in each dataset item. Dotted paths are supported (e.g. <code>metadata.description</code>).",
            "default": "text"
          },
          "datasetIdField": {
            "title": "Dataset ID / URL field",
            "type": "string",
            "description": "Field used as the document ID and URL (e.g. <code>url</code>). Falls back to <code>dataset-&lt;index&gt;</code>.",
            "default": "url"
          },
          "method": {
            "title": "Method",
            "enum": [
              "both",
              "minhash",
              "simhash"
            ],
            "type": "string",
            "description": "<b>both</b> (recommended): MinHash LSH + SimHash candidates, a pair is a duplicate when exact Jaccard <i>or</i> SimHash similarity reaches the threshold. <b>minhash</b>: exact Jaccard on word shingles (strict, best for copied/scraped content). <b>simhash</b>: 64-bit SimHash Hamming similarity (tolerant to small word edits).",
            "default": "both"
          },
          "similarityThreshold": {
            "title": "Similarity threshold",
            "minimum": 0.3,
            "maximum": 1,
            "type": "number",
            "description": "Minimum similarity (0-1) for two documents to be considered near-duplicates. 1 = exact duplicates only. MinHash uses Jaccard similarity of word shingles; SimHash uses 1 - HammingDistance/64.",
            "default": 0.8
          },
          "shingleSize": {
            "title": "Shingle size (words)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Number of consecutive words per shingle for MinHash/Jaccard. Smaller = more tolerant to edits, larger = stricter. 5 is a good default for web pages; use 2-3 for short texts like product titles.",
            "default": 5
          },
          "numPermutations": {
            "title": "MinHash permutations",
            "minimum": 16,
            "maximum": 512,
            "type": "integer",
            "description": "Number of MinHash hash functions. More = more accurate LSH candidate selection but slower. LSH bands and rows are chosen automatically for at least 99% recall at the threshold.",
            "default": 128
          },
          "simhashMaxDistance": {
            "title": "SimHash max Hamming distance",
            "minimum": 0,
            "maximum": 32,
            "type": "integer",
            "description": "Optional override: maximum Hamming distance (0-64) between 64-bit SimHashes for a pair to match. Leave empty to derive it from the similarity threshold (0.8 → 12 bits)."
          },
          "lowercase": {
            "title": "Normalize: lowercase",
            "type": "boolean",
            "description": "Ignore letter case when comparing.",
            "default": true
          },
          "stripPunctuation": {
            "title": "Normalize: strip punctuation",
            "type": "boolean",
            "description": "Ignore punctuation and symbols when comparing.",
            "default": true
          },
          "stripNumbers": {
            "title": "Normalize: strip numbers",
            "type": "boolean",
            "description": "Ignore numbers (prices, dates, counters) when comparing. Useful for listings that only differ by price or date.",
            "default": false
          },
          "canonicalStrategy": {
            "title": "Canonical document",
            "enum": [
              "longest",
              "first"
            ],
            "type": "string",
            "description": "Which document of a cluster is flagged <code>isCanonical</code>: the <b>longest</b> (most complete; ties go to the first) or the <b>first</b> in input order.",
            "default": "longest"
          },
          "maxDuplicatesListed": {
            "title": "Max duplicates listed per document",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Caps the <code>duplicates</code> array of each result (the most similar are kept). <code>duplicateCount</code> is always the full count.",
            "default": 100
          },
          "contentSelector": {
            "title": "Content CSS selector",
            "type": "string",
            "description": "Optional CSS selector for the main content of fetched pages (e.g. <code>.post-body</code>). Default: <code>article</code>, then <code>main</code>, then the cleaned <code>body</code>."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of pages fetched in parallel.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy for fetching URLs (e.g. Apify Proxy for sites that block datacenter IPs).",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}