{
  "openapi": "3.0.1",
  "info": {
    "title": "CSV and Excel Merge, Dedupe and Clean Files",
    "description": "Merge CSV, TSV, JSON, JSON Lines and Excel XLSX files into one clean table. Trims spaces, fixes Unicode, rewrites dates as ISO, drops empty rows and removes duplicates.",
    "version": "0.1",
    "x-build-id": "qZH9XHNAADMzxsOUo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/daddyd-prints~csv-excel-merge-dedupe-clean/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-daddyd-prints-csv-excel-merge-dedupe-clean",
        "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/daddyd-prints~csv-excel-merge-dedupe-clean/runs": {
      "post": {
        "operationId": "runs-sync-daddyd-prints-csv-excel-merge-dedupe-clean",
        "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/daddyd-prints~csv-excel-merge-dedupe-clean/run-sync": {
      "post": {
        "operationId": "run-sync-daddyd-prints-csv-excel-merge-dedupe-clean",
        "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": {
          "csvText": {
            "title": "Paste CSV text",
            "type": "string",
            "description": "Paste a table as CSV, TSV or semicolon separated text, with a header row. Leave it empty if you only use files. The sample shown here is invented product data."
          },
          "fileUrls": {
            "title": "Files to merge",
            "type": "array",
            "description": "Upload files or give their web addresses. Supported: CSV, TSV, JSON (a list of rows), JSON Lines and Excel XLSX. Files are read one at a time, in this order, after the pasted text. Before it reads a web address, the Actor reads that site's robots.txt and skips any file the site does not allow automated tools to read. Skipped files are listed in SKIPPED and are never charged.",
            "items": {
              "type": "string"
            }
          },
          "fileFormat": {
            "title": "File format",
            "enum": [
              "auto",
              "csv",
              "tsv",
              "json",
              "jsonl",
              "xlsx"
            ],
            "type": "string",
            "description": "Auto works out the format of each file from its content, name and type. Choose a format only if auto guesses wrong.",
            "default": "auto"
          },
          "delimiter": {
            "title": "CSV delimiter",
            "enum": [
              "auto",
              "comma",
              "semicolon",
              "tab",
              "pipe"
            ],
            "type": "string",
            "description": "The character between values in CSV text. Auto checks comma, semicolon, tab and pipe and picks the one that splits the rows evenly.",
            "default": "auto"
          },
          "hasHeaderRow": {
            "title": "First row is a header",
            "type": "boolean",
            "description": "On: the first row that is not blank holds the column names. Off: columns are named column_1, column_2 and so on.",
            "default": true
          },
          "sheetName": {
            "title": "Excel sheet name",
            "type": "string",
            "description": "For XLSX files, the sheet to read. Leave it empty to read the first sheet."
          },
          "allSheets": {
            "title": "Read every Excel sheet",
            "type": "boolean",
            "description": "For XLSX files, read every sheet and merge them all into the table.",
            "default": false
          },
          "trimWhitespace": {
            "title": "Trim spaces at the start and end of cells",
            "type": "boolean",
            "description": "Removes spaces, tabs and non breaking spaces before and after each value.",
            "default": true
          },
          "collapseSpaces": {
            "title": "Collapse repeated spaces",
            "type": "boolean",
            "description": "Turns runs of spaces, tabs and non breaking spaces inside a value into one space. Line breaks inside a cell are kept.",
            "default": true
          },
          "unicodeNormalize": {
            "title": "Normalise Unicode (NFC)",
            "type": "boolean",
            "description": "Writes letters with accents the same way every time, so text that looks the same also matches.",
            "default": true
          },
          "dropEmptyRows": {
            "title": "Drop empty rows",
            "type": "boolean",
            "description": "Leaves out rows where every value is empty after cleaning.",
            "default": true
          },
          "removeDuplicates": {
            "title": "Remove duplicate rows",
            "type": "boolean",
            "description": "Keeps one row from each group of duplicates. Turn it off to merge and clean only.",
            "default": true
          },
          "dedupeColumns": {
            "title": "Columns that decide a duplicate",
            "type": "array",
            "description": "Rows count as duplicates when these columns match. Leave it empty to compare every column. Column names are matched ignoring case and extra spaces. If a name is not found, nothing is written and the REPORT lists the columns that exist.",
            "items": {
              "type": "string"
            }
          },
          "keepDuplicate": {
            "title": "Which duplicate to keep",
            "enum": [
              "first",
              "last"
            ],
            "type": "string",
            "description": "First keeps the earliest row. Last keeps the latest row, which is useful when later files hold newer data.",
            "default": "first"
          },
          "ignoreCaseForDuplicates": {
            "title": "Ignore letter case when comparing",
            "type": "boolean",
            "description": "On: Ceramic Mug and ceramic mug count as the same. The kept row keeps its own letter case.",
            "default": true
          },
          "dateColumns": {
            "title": "Date columns to change to ISO format",
            "type": "array",
            "description": "Values in these columns are rewritten as YYYY-MM-DD (with the time added when there is one). Values that cannot be read as a date are left as they were and counted in the REPORT.",
            "items": {
              "type": "string"
            }
          },
          "dateOrder": {
            "title": "Day and month order",
            "enum": [
              "auto",
              "dayFirst",
              "monthFirst"
            ],
            "type": "string",
            "description": "For dates written with numbers, such as 03/04/2026. Auto decides per column from values that can only be read one way, such as 25/03/2026. When a column gives no answer, unclear values are left as they were.",
            "default": "auto"
          },
          "maxRows": {
            "title": "Maximum rows to read",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stops reading after this many rows across all sources. Rows after the limit are not read and not charged. If a very large run runs out of memory, give it more memory in the run options.",
            "default": 50000
          },
          "maxFileSizeMb": {
            "title": "Maximum file size",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Files larger than this are skipped and listed in SKIPPED.",
            "default": 50
          },
          "requestTimeoutSecs": {
            "title": "Server wait timeout",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "How long to wait on the file's server at each step (connecting, sending the request, and each wait for the next part of the file) before the file is skipped as timed out. It is not a limit on the whole download, so a slow but steady file can take longer in total. The robots.txt check waits at most 30 seconds per step.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}