{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Merge, Dedup and Convert (CSV, JSON, XLSX)",
    "description": "Merge CSV, JSON, JSONL and XLSX files or Apify datasets into one table. Remove duplicates by the columns you choose, ignoring case and spaces if wanted. Get one CSV, JSON or XLSX file plus a 100-row dataset preview. Unreadable files are skipped and named in a clear summary. Pay per output row.",
    "version": "0.1",
    "x-build-id": "JMguEj3XDizL1vzy3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/enthusiastic_ginkgo_7ie~dataset-merge-dedup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-enthusiastic_ginkgo_7ie-dataset-merge-dedup",
        "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/enthusiastic_ginkgo_7ie~dataset-merge-dedup/runs": {
      "post": {
        "operationId": "runs-sync-enthusiastic_ginkgo_7ie-dataset-merge-dedup",
        "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/enthusiastic_ginkgo_7ie~dataset-merge-dedup/run-sync": {
      "post": {
        "operationId": "run-sync-enthusiastic_ginkgo_7ie-dataset-merge-dedup",
        "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": {
          "sources": {
            "title": "File URLs",
            "type": "array",
            "description": "Links to CSV, JSON (array of objects), JSONL or XLSX files, in the order they should be merged. Public links, or links that carry their own access signature. The file type comes from the extension, or from the content when there is none. The prefill is five synthetic sample files.",
            "items": {
              "type": "string"
            }
          },
          "datasetIds": {
            "title": "Apify datasets",
            "type": "array",
            "description": "Optional. Datasets to merge in after the files. Pick datasets from your own account."
          },
          "dedupFields": {
            "title": "Dedup fields",
            "type": "array",
            "description": "Column names that identify a duplicate, for example email. Leave empty to treat a row as a duplicate only when every column matches. A row whose dedup fields are all empty is always kept.",
            "items": {
              "type": "string"
            }
          },
          "caseInsensitive": {
            "title": "Ignore upper/lower case when comparing",
            "type": "boolean",
            "description": "Compare dedup values without regard to letter case. The output keeps the original text.",
            "default": false
          },
          "trim": {
            "title": "Ignore leading and trailing spaces when comparing",
            "type": "boolean",
            "description": "Compare dedup values after trimming spaces. The output keeps the original text.",
            "default": true
          },
          "keep": {
            "title": "Keep which duplicate",
            "enum": [
              "first",
              "last"
            ],
            "type": "string",
            "description": "Which row survives when several rows are duplicates: the first one seen, or the last one.",
            "default": "first"
          },
          "columns": {
            "title": "Columns",
            "enum": [
              "union",
              "intersection"
            ],
            "type": "string",
            "description": "Union keeps every column found in any source (missing values stay empty). Intersection keeps only the columns present in every source.",
            "default": "union"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "csv",
              "json",
              "xlsx"
            ],
            "type": "string",
            "description": "Format of the full merged file saved as OUTPUT.csv, OUTPUT.json or OUTPUT.xlsx in the run's key-value store. The dataset holds only a preview of the first 100 rows.",
            "default": "csv"
          },
          "maxRows": {
            "title": "Maximum output rows",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Upper bound on merged rows (the first rows in order are kept). Billing is per output row.",
            "default": 500000
          },
          "sheetName": {
            "title": "Sheet name (XLSX sources)",
            "type": "string",
            "description": "Sheet to read from XLSX files. Leave empty to read the first sheet."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}