{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Cleaner: Filter, Dedupe & Rename Rows [$1/1K]",
    "description": "Clean Apify Dataset rows before a CRM, sheet, n8n or Make step: filter by value or date, remove duplicates, rename, trim, cast and template fields with declarative rules. No JavaScript. $0.02 per 1,000 rows read plus $0.98 per 1,000 kept.",
    "version": "0.1",
    "x-build-id": "DwHtIpFBTfYd2pYmL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automa-flow~dataset-filter-transform/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automa-flow-dataset-filter-transform",
        "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/automa-flow~dataset-filter-transform/runs": {
      "post": {
        "operationId": "runs-sync-automa-flow-dataset-filter-transform",
        "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/automa-flow~dataset-filter-transform/run-sync": {
      "post": {
        "operationId": "run-sync-automa-flow-dataset-filter-transform",
        "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": {
          "datasetId": {
            "title": "Source Dataset",
            "pattern": "^(?:[A-Za-z0-9]{17})?$",
            "type": "string",
            "description": "Dataset to read. Leave this empty when you paste rows in Inline rows. The run needs read access."
          },
          "data": {
            "title": "Inline rows",
            "maxItems": 1000,
            "type": "array",
            "description": "Up to 1,000 JSON objects to clean in this run. Leave this empty when datasetId is set. For more rows, write them to a Dataset first.",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "filterMode": {
            "title": "Filter mode",
            "enum": [
              "AND",
              "OR"
            ],
            "type": "string",
            "description": "AND keeps a row only when every filter matches. OR keeps a row when any filter matches. No filters keeps every row that transforms cleanly.",
            "default": "AND"
          },
          "filters": {
            "title": "Filters",
            "maxItems": 40,
            "type": "array",
            "description": "Up to 40 filters, each {\"op\", \"field\", ...}. equals, notEquals, contains, notContains, startsWith, endsWith: \"value\" to compare. gt, gte, lt, lte: \"value\" as a number, an ISO 8601 date such as \"2026-10-01\" or \"2026-10-01T08:00:00Z\", or a relative bound \"now\", \"now-7d\", \"now-24h\" or \"now-30m\" counted from the run start. A date without a time is midnight UTC. between: \"value\" [low, high] using those same numbers or dates. in, notIn: \"value\" list. regex: \"pattern\", a Python regular expression. empty, notEmpty, true, false: no value. Add \"caseSensitive\": false to compare text in any letter case. Comparisons are exact: the number 10 is not the string \"10\" until a cast transform runs. Missing fields are empty, and they are not equal to null. Field names are top-level: metadata.title is not a nested path. Filters read the names after the transforms, so a name an earlier rename, drop or keep removed fails the run before a row is read.",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "op",
                "field"
              ],
              "properties": {
                "op": {
                  "title": "Operation",
                  "type": "string",
                  "editor": "select",
                  "description": "equals, notEquals, contains, notContains, startsWith, endsWith, regex, in, notIn, gt, gte, lt, lte, between, empty, notEmpty, true or false. gt, gte, lt, lte and between take a number or an ISO 8601 date, including now, now-7d, now-24h and now-30m.",
                  "enum": [
                    "equals",
                    "notEquals",
                    "contains",
                    "notContains",
                    "startsWith",
                    "endsWith",
                    "regex",
                    "in",
                    "notIn",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "between",
                    "empty",
                    "notEmpty",
                    "true",
                    "false"
                  ]
                },
                "field": {
                  "title": "Field",
                  "type": "string",
                  "editor": "textfield",
                  "description": "Top-level field name, 1-200 characters. A dotted name is not a nested path.",
                  "minLength": 1,
                  "maxLength": 200
                },
                "pattern": {
                  "title": "Regular expression",
                  "type": "string",
                  "editor": "textfield",
                  "description": "Python regular expression for the regex filter. 1-200 characters. It searches the field; it does not have to match the whole value.",
                  "minLength": 1,
                  "maxLength": 200
                },
                "caseSensitive": {
                  "title": "Case sensitive",
                  "type": "boolean",
                  "editor": "checkbox",
                  "description": "For equals, notEquals, contains, notContains, startsWith, endsWith, in, notIn and regex. false compares text in any letter case. Default true."
                }
              }
            }
          },
          "transforms": {
            "title": "Transforms",
            "maxItems": 40,
            "type": "array",
            "description": "Up to 40 transforms, applied in order before filters, each {\"op\", \"field\", ...}. rename: \"field\", \"to\". drop: \"field\" or \"fields\". keep: \"fields\". trim, lowercase, uppercase: \"field\" or \"fields\", or one \"field\" and \"to\" to write the result to a new field. cast: \"field\", \"to\" string, number, integer or boolean (a blank cell becomes null). default: \"field\", \"value\". regexReplace: \"field\", \"pattern\", \"replacement\" (empty removes the matches). regexExtract: \"field\", \"pattern\", optional \"to\". template: \"field\", \"template\" with {{otherField}}. A transform that cannot be applied drops that row and records a code in RUN_SUMMARY. It does not write a guessed value. Field names are top-level: metadata.title is not a nested path.",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "op"
              ],
              "properties": {
                "op": {
                  "title": "Operation",
                  "type": "string",
                  "editor": "select",
                  "description": "rename, drop, keep, trim, lowercase, uppercase, cast, default, regexReplace, regexExtract or template.",
                  "enum": [
                    "rename",
                    "drop",
                    "keep",
                    "trim",
                    "lowercase",
                    "uppercase",
                    "cast",
                    "default",
                    "regexReplace",
                    "regexExtract",
                    "template"
                  ]
                },
                "field": {
                  "title": "Field",
                  "type": "string",
                  "editor": "textfield",
                  "description": "Field to read or, for template and default, the field to write.",
                  "minLength": 1,
                  "maxLength": 200
                },
                "fields": {
                  "title": "Fields",
                  "type": "array",
                  "editor": "stringList",
                  "description": "Field names for drop, keep, trim, lowercase or uppercase. At most 100. A dotted name is not a nested path.",
                  "maxItems": 100,
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "to": {
                  "title": "Destination or cast",
                  "type": "string",
                  "editor": "textfield",
                  "description": "New field name for rename, regexExtract, or a one-field trim, lowercase or uppercase. For cast, string, number, integer or boolean.",
                  "minLength": 1,
                  "maxLength": 200
                },
                "pattern": {
                  "title": "Regular expression",
                  "type": "string",
                  "editor": "textfield",
                  "description": "Pattern for regexReplace or regexExtract. 1-200 characters.",
                  "minLength": 1,
                  "maxLength": 200
                },
                "replacement": {
                  "title": "Replacement",
                  "type": "string",
                  "editor": "textfield",
                  "description": "Replacement text for regexReplace, including backreferences such as \\1. Empty or omitted removes the matches. Up to 2,000 characters.",
                  "maxLength": 2000
                },
                "template": {
                  "title": "Template",
                  "type": "string",
                  "editor": "textfield",
                  "description": "New field value. {{field}} inserts a top-level scalar. Missing fields become empty. Up to 2,000 characters.",
                  "minLength": 1,
                  "maxLength": 2000
                }
              }
            }
          },
          "dedupeBy": {
            "title": "Remove duplicates by",
            "maxItems": 10,
            "type": "array",
            "description": "Field names that identify a row, such as email or url. After the transforms and filters, only the first row for each value is written; later rows are counted in rowsDuplicate and charged as read, not kept. Values compare exactly, so lowercase an email first. Rows whose key fields are all empty are kept. Up to 10 fields.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "maxItems": {
            "title": "Maximum kept rows",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Stop after this many kept rows. 1 to 10000000. Omit it to process the whole source. Filtered, duplicate, skipped and failed rows do not count toward this cap."
          },
          "outputDatasetName": {
            "title": "Output dataset name",
            "pattern": "^(?:[A-Za-z0-9_-]{1,63})?$",
            "maxLength": 63,
            "type": "string",
            "description": "Optional. Empty writes the run's default dataset, which a webhook can pass on as datasetId. A name stores rows in that dataset instead. Leave it empty if the run cannot create datasets.",
            "default": ""
          },
          "payload": {
            "title": "Integration payload",
            "type": "object",
            "description": "Added by an Apify Actor-to-Actor integration. It is accepted so the run can start and is not read. Set datasetId to {{resource.defaultDatasetId}} in the integration input."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}