{
  "openapi": "3.0.1",
  "info": {
    "title": "CSV & Excel Data Cleaner | Dedupe & Fix",
    "description": "Clean CSV, Excel & JSON in bulk: fix encoding, dates, numbers & currency, flag bad emails, remove duplicates (fuzzy too). Full change log. No AI.",
    "version": "0.1",
    "x-build-id": "UwIYQGqMb5duU6OXq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/makentest~csv-excel-data-cleaner-dedupe-fix/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-makentest-csv-excel-data-cleaner-dedupe-fix",
        "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/makentest~csv-excel-data-cleaner-dedupe-fix/runs": {
      "post": {
        "operationId": "runs-sync-makentest-csv-excel-data-cleaner-dedupe-fix",
        "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/makentest~csv-excel-data-cleaner-dedupe-fix/run-sync": {
      "post": {
        "operationId": "run-sync-makentest-csv-excel-data-cleaner-dedupe-fix",
        "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": {
          "sourceType": {
            "title": "Source type",
            "enum": [
              "text",
              "url",
              "dataset",
              "keyValueStore"
            ],
            "type": "string",
            "description": "Where the data comes from. Fill in the matching field below.",
            "default": "text"
          },
          "pastedText": {
            "title": "Pasted text",
            "type": "string",
            "description": "CSV or JSON text (max 5 MB). Used when Source type is 'Pasted text'.",
            "default": ""
          },
          "fileUrl": {
            "title": "Data file (upload or URL)",
            "type": "string",
            "description": "Upload your .csv, .xlsx or .json file here (Console: pick 'Upload' to store it in a key-value store), or paste a public http(s) link. The file is read once; only the location you give is contacted.",
            "default": ""
          },
          "datasetId": {
            "title": "Apify dataset ID",
            "type": "string",
            "description": "ID of the dataset to clean (e.g. output of another Actor). Nested values are converted to JSON text.",
            "default": ""
          },
          "kvStoreId": {
            "title": "Key-value store ID",
            "type": "string",
            "description": "Leave empty to use this run's default store. Used with 'Record key'.",
            "default": ""
          },
          "kvRecordKey": {
            "title": "Record key",
            "type": "string",
            "description": "Key of the CSV, XLSX or JSON record to clean.",
            "default": ""
          },
          "inputFormat": {
            "title": "File format",
            "enum": [
              "auto",
              "csv",
              "xlsx",
              "json"
            ],
            "type": "string",
            "description": "Auto-detect from the content, or force a format.",
            "default": "auto"
          },
          "sheetName": {
            "title": "Excel sheet name",
            "type": "string",
            "description": "Sheet to read. Empty = first sheet.",
            "default": ""
          },
          "hasHeader": {
            "title": "First row is a header",
            "type": "boolean",
            "description": "Untick if the file has no header row; columns are then named column_1, column_2, ...",
            "default": true
          },
          "encoding": {
            "title": "Text encoding",
            "enum": [
              "auto",
              "utf-8",
              "cp1252",
              "latin-1",
              "utf-16"
            ],
            "type": "string",
            "description": "Auto tries UTF-8 first, then Windows-1252. Pick one explicitly if accents look wrong.",
            "default": "auto"
          },
          "delimiter": {
            "title": "CSV delimiter",
            "enum": [
              "auto",
              ",",
              ";",
              "\t",
              "|"
            ],
            "type": "string",
            "description": "Field separator of the CSV input.",
            "default": "auto"
          },
          "trimWhitespace": {
            "title": "Trim whitespace",
            "type": "boolean",
            "description": "Remove leading/trailing spaces from every cell.",
            "default": true
          },
          "collapseInternalSpaces": {
            "title": "Collapse repeated spaces",
            "type": "boolean",
            "description": "Turn runs of spaces/tabs inside a cell into one space ('Ana   García' → 'Ana García').",
            "default": false
          },
          "repairEncoding": {
            "title": "Repair encoding problems",
            "type": "boolean",
            "description": "Fix mojibake (e.g. 'CafÃ©' → 'Café'), smart quotes, invisible characters and non-breaking spaces.",
            "default": true
          },
          "headerCase": {
            "title": "Normalize headers",
            "enum": [
              "none",
              "snake_case",
              "lower",
              "upper",
              "title"
            ],
            "type": "string",
            "description": "Headers are always trimmed, de-duplicated and never empty. Choose a casing style, or keep the originals.",
            "default": "none"
          },
          "normalizeBlanks": {
            "title": "Normalize blanks / nulls",
            "type": "boolean",
            "description": "Treat empty cells and the null tokens below as one consistent empty value.",
            "default": true
          },
          "nullTokens": {
            "title": "Null tokens",
            "type": "array",
            "description": "Cell texts treated as empty (exact match after trimming). Note '-' and '0' are never treated as null unless you add them.",
            "items": {
              "type": "string"
            },
            "default": [
              "null",
              "NULL",
              "N/A",
              "n/a",
              "NA",
              "#N/A",
              "nan",
              "NaN",
              "none",
              "None"
            ]
          },
          "blankFill": {
            "title": "Fill empty cells with",
            "type": "string",
            "description": "Text written into empty cells of CSV/XLSX output (JSON and dataset keep null). Empty = leave blank.",
            "default": ""
          },
          "caseRules": {
            "title": "Value casing rules",
            "type": "array",
            "description": "List of {\"column\": \"Name\", \"case\": \"title\"} (case: lower, upper, title). Use \"*\" for all columns.",
            "items": {
              "type": "object"
            },
            "default": []
          },
          "findReplaceRules": {
            "title": "Find / replace rules",
            "type": "array",
            "description": "List of {\"column\": \"*\", \"find\": \"St.\", \"replace\": \"Street\", \"mode\": \"literal|regex\", \"caseSensitive\": true, \"wholeCell\": false}. Applied in order.",
            "items": {
              "type": "object"
            },
            "default": []
          },
          "numericColumns": {
            "title": "Numeric columns",
            "type": "array",
            "description": "Columns to convert into true numbers: strips currency symbols/codes, % and thousands separators; (1,234) becomes -1234.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "decimalSeparator": {
            "title": "Decimal separator",
            "enum": [
              "auto",
              ".",
              ","
            ],
            "type": "string",
            "description": "'Auto' treats '1,234' as 1234 and '1,5' as 1.5. Pick one when your data is consistently European or US.",
            "default": "auto"
          },
          "percentMode": {
            "title": "Percent handling",
            "enum": [
              "number",
              "fraction"
            ],
            "type": "string",
            "description": "'10%' becomes 10 (number) or 0.1 (fraction).",
            "default": "number"
          },
          "dateColumns": {
            "title": "Date columns",
            "type": "array",
            "description": "Columns to convert into one consistent date format.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "dayFirst": {
            "title": "Day before month (31/12/2024)",
            "type": "boolean",
            "description": "How to read ambiguous dates like 03/04/2024. Ambiguous values are flagged in the output.",
            "default": false
          },
          "dateOutputFormat": {
            "title": "Date output format",
            "enum": [
              "iso",
              "iso_date",
              "us",
              "eu"
            ],
            "type": "string",
            "description": "ISO keeps a time part when the input had one; 'ISO date only' removes it.",
            "default": "iso"
          },
          "emailColumns": {
            "title": "Email columns",
            "type": "array",
            "description": "Columns checked for a valid email format (flags only; no emails are verified or sent).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "lowercaseEmails": {
            "title": "Lowercase emails",
            "type": "boolean",
            "description": "Lowercase values in the email columns.",
            "default": true
          },
          "phoneColumns": {
            "title": "Phone columns",
            "type": "array",
            "description": "Columns checked for a plausible phone format (7–15 digits).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "phoneFormat": {
            "title": "Phone output",
            "enum": [
              "none",
              "e164"
            ],
            "type": "string",
            "description": "'E.164' only rewrites numbers that already start with + or 00; other numbers are left unchanged and flagged.",
            "default": "none"
          },
          "includeColumns": {
            "title": "Keep only these columns",
            "type": "array",
            "description": "Empty = keep all columns.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "excludeColumns": {
            "title": "Drop these columns",
            "type": "array",
            "description": "Columns removed from the output.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "requiredColumns": {
            "title": "Required columns",
            "type": "array",
            "description": "Rows with an empty value here are handled by the error policy.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "errorPolicy": {
            "title": "Error policy",
            "enum": [
              "quarantine",
              "keep",
              "skip",
              "fail"
            ],
            "type": "string",
            "description": "What to do with a row that has an unparseable number/date, a missing required value or too many cells.",
            "default": "quarantine"
          },
          "preserveOriginals": {
            "title": "Preserve originals",
            "type": "boolean",
            "description": "Adds an '_original' column with the original values of every cell that was changed in that row.",
            "default": false
          },
          "dedupeMode": {
            "title": "Duplicate detection",
            "enum": [
              "none",
              "exact",
              "key",
              "fuzzy"
            ],
            "type": "string",
            "description": "How duplicates are found.",
            "default": "none"
          },
          "dedupeKeyColumns": {
            "title": "Key columns",
            "type": "array",
            "description": "Required for key and fuzzy modes.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "dedupeCaseInsensitive": {
            "title": "Ignore case in key",
            "type": "boolean",
            "description": "Key mode only: compare keys case-insensitively and trimmed.",
            "default": true
          },
          "fuzzyThreshold": {
            "title": "Fuzzy similarity threshold",
            "minimum": 0.5,
            "maximum": 1,
            "type": "number",
            "description": "0.5–1.0. Higher = stricter. Keys are lowercased, accent-stripped and punctuation-free before comparing.",
            "default": 0.9
          },
          "duplicatePrecedence": {
            "title": "Which duplicate wins",
            "enum": [
              "first",
              "last",
              "mostComplete"
            ],
            "type": "string",
            "description": "The row that stays in the clean output.",
            "default": "first"
          },
          "quarantineDuplicates": {
            "title": "Send removed duplicates to Rejected export",
            "type": "boolean",
            "description": "Keeps an audit trail of every removed row.",
            "default": true
          },
          "outputFormats": {
            "title": "Export formats",
            "type": "array",
            "description": "Files saved to the key-value store (CLEAN.csv / CLEAN.json / CLEAN.xlsx). Excel has Clean, Rejected and Summary tabs.",
            "items": {
              "type": "string",
              "enum": [
                "csv",
                "json",
                "xlsx"
              ],
              "enumTitles": [
                "CSV",
                "JSON",
                "Excel (.xlsx)"
              ]
            },
            "default": [
              "csv"
            ]
          },
          "outputCsvDelimiter": {
            "title": "CSV output delimiter",
            "enum": [
              ",",
              ";",
              "\t",
              "|"
            ],
            "type": "string",
            "description": "Field separator used in CLEAN.csv and REJECTED.csv.",
            "default": ","
          },
          "csvUtf8Bom": {
            "title": "Add UTF-8 BOM to CSV",
            "type": "boolean",
            "description": "Helps older Excel versions open accents correctly.",
            "default": false
          },
          "escapeFormulaCells": {
            "title": "Neutralize spreadsheet formulas in CSV",
            "type": "boolean",
            "description": "Prefix text cells starting with = + - @ with an apostrophe (numbers untouched). Changes data, so off by default. XLSX output never stores text as formulas.",
            "default": false
          },
          "includeFlagsColumn": {
            "title": "Add '_flags' column",
            "type": "boolean",
            "description": "Shows validation flags per row when email/phone checks or the 'keep' policy are used.",
            "default": true
          },
          "changeLog": {
            "title": "Write row-level change log",
            "type": "boolean",
            "description": "CHANGE_LOG.csv: every changed cell with the rules that changed it.",
            "default": true
          },
          "changeLogIncludeValues": {
            "title": "Include values in change log",
            "type": "boolean",
            "description": "Untick to log only row/column/rule (no before/after values) if the log is shared.",
            "default": true
          },
          "maxChangeLogEntries": {
            "title": "Max change log entries",
            "minimum": 0,
            "maximum": 200000,
            "type": "integer",
            "description": "Counts stay exact; entries beyond the cap are not written.",
            "default": 10000
          },
          "profileColumns": {
            "title": "Column profiling report",
            "enum": [
              "off",
              "after",
              "both"
            ],
            "type": "string",
            "description": "Type, % null, unique count and top values per column (COLUMN_PROFILE.json).",
            "default": "after"
          },
          "settingsFileUrl": {
            "title": "Settings file (JSON, optional)",
            "type": "string",
            "description": "Upload or link a JSON file with settings, e.g. {\"headerCase\":\"snake_case\",\"numericColumns\":[\"Price\"]}. Values in the file replace the same fields in this form. Source fields cannot be set in it. Same format as the local 'clean_local.py --settings' file.",
            "default": ""
          },
          "profileName": {
            "title": "Load saved profile",
            "type": "string",
            "description": "Name of a profile saved earlier. Its cleaning settings (sections 2–5) replace the ones in this form.",
            "default": ""
          },
          "profileJson": {
            "title": "Inline profile (JSON)",
            "type": "object",
            "description": "Paste a profile document {\"profileVersion\":1,\"settings\":{...}} instead of loading by name. Do not set both."
          },
          "saveProfileAs": {
            "title": "Save these settings as profile",
            "type": "string",
            "description": "Letters, digits, . _ - only (max 60). Saved after a successful run.",
            "default": ""
          },
          "dryRun": {
            "title": "Dry run (preview)",
            "type": "boolean",
            "description": "Process only a small sample, never charge, and mark the result as a preview.",
            "default": false
          },
          "dryRunSampleSize": {
            "title": "Dry run sample size",
            "minimum": 10,
            "maximum": 1000,
            "type": "integer",
            "description": "Rows processed in dry run.",
            "default": 100
          },
          "chunkSize": {
            "title": "Chunk size",
            "minimum": 100,
            "maximum": 10000,
            "type": "integer",
            "description": "Rows processed per chunk. Keeps memory bounded.",
            "default": 1000
          },
          "maxRows": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 5000000,
            "type": "integer",
            "description": "Rows beyond this are not processed.",
            "default": 500000
          },
          "maxFileSizeMb": {
            "title": "Max input size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger inputs fail before processing.",
            "default": 100
          },
          "maxOutputSizeMb": {
            "title": "Max output size (MB, per file)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Processing stops cleanly when exceeded.",
            "default": 200
          },
          "timeoutSeconds": {
            "title": "Timeout (seconds)",
            "minimum": 30,
            "maximum": 86400,
            "type": "integer",
            "description": "Processing stops cleanly when exceeded.",
            "default": 3000
          },
          "memoryLimitMb": {
            "title": "Memory guard (MB)",
            "minimum": 0,
            "maximum": 32768,
            "type": "integer",
            "description": "0 = 85% of the run's memory. Processing stops cleanly if exceeded.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}