{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Transform Pro: Merge, Filter, Dedupe, Only New Rows",
    "description": "All-in-one data cleanup for Apify datasets and CSV, JSON, Excel or Google Sheets files: merge, filter, flatten and rename, exact or fuzzy dedupe, explode arrays, keep only rows new since the last run, sort, export CSV/XLSX/JSON. Empty input = free demo.",
    "version": "0.1",
    "x-build-id": "FerkeiQblLj8LDE3Z"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ucchiii~dataset-transform-pro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ucchiii-dataset-transform-pro",
        "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/ucchiii~dataset-transform-pro/runs": {
      "post": {
        "operationId": "runs-sync-ucchiii-dataset-transform-pro",
        "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/ucchiii~dataset-transform-pro/run-sync": {
      "post": {
        "operationId": "run-sync-ucchiii-dataset-transform-pro",
        "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": {
          "datasetIds": {
            "title": "Datasets",
            "type": "array",
            "description": "Apify datasets to read, in order (e.g. the defaultDatasetId of finished scraper runs). You can paste dataset URLs from Apify Console too. Up to 20 sources per run (datasets and files together). Leave datasets AND file URLs empty for a free demo on sample data (not charged)."
          },
          "fileUrls": {
            "title": "File URLs (CSV, TSV, JSON, NDJSON, XLSX)",
            "type": "array",
            "description": "Public http(s) links to files, read after the datasets. CSV, TSV, JSON (array), NDJSON and Excel XLSX (first sheet). A Google Sheets link shared as 'Anyone with the link' is read as CSV (the tab in the link). Each file up to 100 MB (JSON arrays up to 50 MB).",
            "items": {
              "type": "string"
            }
          },
          "addSourceColumn": {
            "title": "Add a _source column",
            "type": "boolean",
            "description": "Add a '_source' column (last column) with the dataset ID or file URL each row came from. Filters can use it too.",
            "default": false
          },
          "filters": {
            "title": "Filters",
            "type": "array",
            "description": "Keep only rows that match. One condition per line: column, operator, value. Operators: = != > >= < <= contains, not contains, starts with, ends with, in (comma list), not in, is empty, is not empty. Text is compared without case, numbers as numbers, ISO dates work with > and <. Column names are the ORIGINAL names (nested: address.city). Through the API you can also pass objects like {\"field\": \"price\", \"op\": \"gt\", \"value\": 10}.",
            "items": {
              "type": "string"
            }
          },
          "filterMode": {
            "title": "Combine filters with",
            "enum": [
              "all",
              "any"
            ],
            "type": "string",
            "description": "Whether a row must match all filters or just one.",
            "default": "all"
          },
          "select": {
            "title": "Keep only these columns",
            "type": "array",
            "description": "Columns to output, in this order. Use the flattened name, e.g. 'address.city'. A parent name such as 'address' keeps all columns under it. Empty = all columns.",
            "items": {
              "type": "string"
            }
          },
          "omit": {
            "title": "Remove these columns",
            "type": "array",
            "description": "Columns to drop. A parent name such as 'meta' removes everything under it. Applied after 'Keep only these columns'.",
            "items": {
              "type": "string"
            }
          },
          "rename": {
            "title": "Rename columns",
            "type": "object",
            "description": "Map of flattened column name to new name, e.g. {\"address.city\": \"city\"}. Two columns cannot share a new name. Later steps (dedupe, explode, only new, sort) use the NEW names."
          },
          "coerce": {
            "title": "Convert column types",
            "type": "object",
            "description": "Map of flattened column name to type: string, number, integer, boolean or date. Example: {\"price\": \"number\", \"createdAt\": \"date\"}. Numbers accept '$1,234.50'; dates become ISO 8601 UTC. Values that cannot be converted become empty and are counted in STATS."
          },
          "maxDepth": {
            "title": "Flatten depth",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "How many levels of nested objects to flatten into dot-path columns (address.geo.lat). 0 = do not flatten. Default 10.",
            "default": 10
          },
          "arrayMode": {
            "title": "Arrays",
            "enum": [
              "json",
              "join",
              "index",
              "first",
              "count"
            ],
            "type": "string",
            "description": "How arrays become columns (the explode column is never changed by this). Default: json.",
            "default": "json"
          },
          "arrayJoinSeparator": {
            "title": "Join separator",
            "type": "string",
            "description": "Text between values when Arrays = join. Default '; '.",
            "default": "; "
          },
          "flattenSeparator": {
            "title": "Path separator",
            "type": "string",
            "description": "Character(s) that join nested names in flattened columns ('.' gives address.city). Column names in other settings must use the same separator. Max 5 characters.",
            "default": "."
          },
          "trimStrings": {
            "title": "Trim spaces in text",
            "type": "boolean",
            "description": "Remove leading and trailing spaces from all text values.",
            "default": false
          },
          "dedupeBy": {
            "title": "Remove duplicates by",
            "type": "array",
            "description": "Columns that identify a duplicate (output names, after renaming), e.g. url, or name + city. '*' = rows identical in every column. Empty = no dedupe. Text is compared ignoring case and extra spaces.",
            "items": {
              "type": "string"
            }
          },
          "dedupeMode": {
            "title": "Match",
            "enum": [
              "exact",
              "fuzzy"
            ],
            "type": "string",
            "description": "Fuzzy compares each column by its name: *name/company/title* ignore legal forms and punctuation, *address* expands street abbreviations, *phone* compares digits, *url/website/email* the domain; others as plain text. With 2+ columns, at least two must agree (or a phone / url). Up to 200,000 rows.",
            "default": "exact"
          },
          "dedupeKeep": {
            "title": "Keep",
            "enum": [
              "first",
              "last"
            ],
            "type": "string",
            "description": "Which row of a duplicate group stays. 'last' is handy when later sources hold fresher data.",
            "default": "first"
          },
          "fuzzyThreshold": {
            "title": "Fuzzy match threshold (0.5-1)",
            "minimum": 0.5,
            "maximum": 1,
            "type": "number",
            "description": "Only for fuzzy: minimum similarity for two rows to count as the same. Lower finds more (and riskier) matches. Default 0.9.",
            "default": 0.9
          },
          "explodeField": {
            "title": "Explode array column",
            "type": "string",
            "description": "Column with an array (output name, after renaming), e.g. 'tags' or 'reviews'. Each element becomes its own row with the other columns copied; object elements become columns like reviews.text. A JSON array written as text also works. Empty or missing arrays keep one row."
          },
          "explodeSeparator": {
            "title": "Or split text by",
            "type": "string",
            "description": "Optional: also explode plain text values split by this separator, e.g. ';' turns 'red; blue' into two rows. Useful for CSV files."
          },
          "onlyNew": {
            "title": "Only rows not output before",
            "type": "boolean",
            "description": "Remember the rows each run writes (in a key-value store named 'dataset-transform-pro-state' in your account) and output only rows not written by earlier runs with the same state name. The first run outputs everything. Rows cut by max rows or the cost limit are not remembered.",
            "default": false
          },
          "onlyNewFields": {
            "title": "Columns that identify a row",
            "type": "array",
            "description": "For 'only new rows': columns that make a row the same as before (output names), e.g. url or id. Empty = the whole row (any changed value counts as new).",
            "items": {
              "type": "string"
            }
          },
          "stateName": {
            "title": "State name",
            "type": "string",
            "description": "Separate memory for each scheduled job, e.g. 'jobs-berlin'. Letters, digits, dot, dash and underscore. A new name starts from scratch.",
            "default": "default"
          },
          "sortBy": {
            "title": "Sort by column",
            "type": "string",
            "description": "Column to sort by (output name). Numbers (also numbers written as text, e.g. from CSV) sort before text; empty values always go last. Empty = keep the order."
          },
          "sortDesc": {
            "title": "Sort descending",
            "type": "boolean",
            "description": "High to low / Z to A.",
            "default": false
          },
          "maxRows": {
            "title": "Max output rows",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Write at most this many rows (after sorting). Empty = no limit (hard cap 1,000,000). Billing is per output row, so this also caps cost."
          },
          "exportFormat": {
            "title": "Also save a file",
            "enum": [
              "none",
              "csv",
              "xlsx",
              "json"
            ],
            "type": "string",
            "description": "Besides the dataset, save the output rows as a file in the run's key-value store, with a download link in the STATS record (fileUrl). Up to 150 MB. Not charged extra.",
            "default": "none"
          },
          "fileName": {
            "title": "File name",
            "type": "string",
            "description": "File name without extension. Only letters, digits, dot, dash and underscore are kept.",
            "default": "export"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}