{
  "openapi": "3.0.1",
  "info": {
    "title": "🧽 Dataset Deduplicator - Clean Any Scraped Dataset",
    "description": "🧽 Upload any dataset — scraped rows, a RAG corpus, an export — and get back exact AND near-duplicates removed, plus a per-field data quality report. ✅ MinHash + LSH banding finds near-duplicate text at scale without O(n²) pairwise comparison.",
    "version": "1.0",
    "x-build-id": "hiUxapSn440GMmew5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/that_red_bird~dataset-deduplicator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-that_red_bird-dataset-deduplicator",
        "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/that_red_bird~dataset-deduplicator/runs": {
      "post": {
        "operationId": "runs-sync-that_red_bird-dataset-deduplicator",
        "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/that_red_bird~dataset-deduplicator/run-sync": {
      "post": {
        "operationId": "run-sync-that_red_bird-dataset-deduplicator",
        "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": {
          "records": {
            "title": "Records",
            "type": "array",
            "description": "The dataset to clean, as an array of flat row objects. Combine freely with datasetIds. Nested arrays/objects per row are not supported.",
            "default": [
              {
                "title": "Best wireless headphones 2024",
                "body": "These wireless headphones deliver excellent sound quality and battery life for the price."
              },
              {
                "title": "Best wireless headphones 2024",
                "body": "These wireless headphones deliver excellent sound quality and battery life for the price."
              },
              {
                "title": "Best wireless headphones of 2024",
                "body": "These wireless headphones deliver great sound quality and long battery life for the price."
              },
              {
                "title": "Top budget laptops this year",
                "body": "A roundup of the best budget laptops you can buy right now, covering performance and battery."
              }
            ]
          },
          "datasetIds": {
            "title": "Source dataset IDs",
            "type": "array",
            "description": "Apify dataset IDs to pull additional rows from (e.g. the output of a scraping actor). Rows are appended to \"records\" before deduplication.",
            "items": {
              "type": "string"
            }
          },
          "idField": {
            "title": "ID field",
            "type": "string",
            "description": "Field to use as each record's identifier in the output (e.g. \"url\" or \"sku\"). Leave empty to auto-generate an id (R000001, R000002, ...)."
          },
          "textFields": {
            "title": "Text fields to compare (advanced)",
            "type": "array",
            "description": "Which fields hold free text to check for near-duplicates. Leave empty to auto-detect long string columns (average length above \"Auto-detect text length threshold\").",
            "items": {
              "type": "string"
            }
          },
          "textFieldMinAvgLength": {
            "title": "Auto-detect text length threshold",
            "minimum": 5,
            "maximum": 1000,
            "type": "integer",
            "description": "When textFields is empty, a column is treated as free text if its average string length across the sampled rows is at least this many characters.",
            "default": 40
          },
          "similarityThreshold": {
            "title": "Near-duplicate similarity threshold (0-100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Two records are treated as near-duplicates when their text overlap (Jaccard similarity over shingles) is at or above this. Higher = fewer false merges, more missed near-duplicates. Expressed 0-100; 80 means 0.80.",
            "default": 80
          },
          "shingleSize": {
            "title": "Shingle size (words)",
            "minimum": 2,
            "maximum": 10,
            "type": "integer",
            "description": "Length of the word n-grams used to fingerprint each document. Smaller catches shorter edits but is noisier; larger is stricter. Short text automatically falls back to character shingles instead.",
            "default": 3
          },
          "numHashes": {
            "title": "MinHash signature size",
            "minimum": 8,
            "maximum": 256,
            "type": "integer",
            "description": "How many hash functions make up each document's MinHash signature. Higher gives a more accurate similarity estimate for candidate generation but costs more CPU. Must be >= numBands.",
            "default": 32
          },
          "numBands": {
            "title": "LSH bands",
            "minimum": 2,
            "maximum": 128,
            "type": "integer",
            "description": "How many bands the MinHash signature is split into for LSH bucketing. More bands catch weaker matches (higher recall, more candidate pairs to verify); fewer bands are stricter and faster.",
            "default": 8
          },
          "maxBucketSize": {
            "title": "Max LSH bucket size",
            "minimum": 10,
            "maximum": 20000,
            "type": "integer",
            "description": "An LSH bucket larger than this is skipped when generating candidate pairs, to avoid an O(n²) blowup if many records hash into the same bucket (e.g. many rows with blank text).",
            "default": 500
          },
          "includeKept": {
            "title": "Include kept records",
            "type": "boolean",
            "description": "Emit the deduplicated, cleaned records (type: \"kept\").",
            "default": true
          },
          "includeRemoved": {
            "title": "Include removed duplicates",
            "type": "boolean",
            "description": "Emit every removed row (type: \"duplicate\") with the id of the record it duplicates, the similarity score, and whether it was an exact or near match.",
            "default": true
          },
          "includeQualityReport": {
            "title": "Include quality report",
            "type": "boolean",
            "description": "Emit one summary row (type: \"qualityReport\") with per-field completeness/uniqueness/type-consistency/outliers and an overall 0-100 quality score.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}