{
  "openapi": "3.0.1",
  "info": {
    "title": "JSON Dataset Cleaner and Deduplicator",
    "description": "Clean JSON datasets, remove empty rows, deduplicate by any field, validate emails, and prepare scraper output for CRMs, analysis, or AI workflows.",
    "version": "1.0",
    "x-build-id": "U1Eavdcwc19Fcwhtd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rodrgds~dataset-cleaner/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rodrgds-dataset-cleaner",
        "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/rodrgds~dataset-cleaner/runs": {
      "post": {
        "operationId": "runs-sync-rodrgds-dataset-cleaner",
        "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/rodrgds~dataset-cleaner/run-sync": {
      "post": {
        "operationId": "run-sync-rodrgds-dataset-cleaner",
        "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",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "title": "Data",
            "type": "array",
            "description": "Array of JSON objects to clean. Each object is treated as one row.",
            "items": {
              "type": "object"
            }
          },
          "textColumns": {
            "title": "Text columns",
            "type": "array",
            "description": "String fields to clean. Leave empty to clean all string fields.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "trimWhitespace": {
            "title": "Trim whitespace",
            "type": "boolean",
            "description": "Remove leading and trailing whitespace from selected text fields.",
            "default": true
          },
          "collapseWhitespace": {
            "title": "Collapse whitespace",
            "type": "boolean",
            "description": "Replace repeated whitespace inside text fields with a single space.",
            "default": true
          },
          "removeControlCharacters": {
            "title": "Remove control characters",
            "type": "boolean",
            "description": "Remove non-printing control characters from text fields.",
            "default": true
          },
          "emailColumns": {
            "title": "Email columns",
            "type": "array",
            "description": "Email fields to normalize and validate. Leave empty to auto-detect fields containing email.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "normalizeEmails": {
            "title": "Normalize emails",
            "type": "boolean",
            "description": "Trim and lowercase email addresses, then validate their shape.",
            "default": true
          },
          "requireValidEmail": {
            "title": "Require valid email",
            "type": "boolean",
            "description": "Reject rows with invalid email values instead of keeping them with warnings.",
            "default": false
          },
          "phoneColumns": {
            "title": "Phone columns",
            "type": "array",
            "description": "Phone fields to normalize and validate. Leave empty to auto-detect phone, mobile, and tel fields.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "defaultPhoneCountry": {
            "title": "Default phone country",
            "type": "string",
            "description": "ISO-2 country code used when phone numbers do not include a country prefix.",
            "default": "US"
          },
          "normalizePhones": {
            "title": "Normalize phones",
            "type": "boolean",
            "description": "Parse phone numbers, output E.164, and add national format, country, and type metadata when available.",
            "default": true
          },
          "requireValidPhone": {
            "title": "Require valid phone",
            "type": "boolean",
            "description": "Reject rows with invalid phone values instead of keeping them with warnings.",
            "default": false
          },
          "urlColumns": {
            "title": "URL columns",
            "type": "array",
            "description": "URL, website, or domain fields to normalize. Leave empty to auto-detect url, website, and domain fields.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "normalizeUrls": {
            "title": "Normalize URLs",
            "type": "boolean",
            "description": "Trim URLs, add https:// when missing, lowercase hostnames, and normalize domain-only fields to hostnames.",
            "default": true
          },
          "dateColumns": {
            "title": "Date columns",
            "type": "array",
            "description": "Date fields to normalize to YYYY-MM-DD when the date is unambiguous.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "numberColumns": {
            "title": "Number columns",
            "type": "array",
            "description": "Number fields to normalize by removing common currency symbols and thousands separators when safe.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "dedupKeys": {
            "title": "Deduplication keys",
            "type": "array",
            "description": "Fields used together as the deduplication key after normalization.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "removeEmpty": {
            "title": "Remove empty rows",
            "type": "boolean",
            "description": "Reject rows where all fields are blank, null, or missing.",
            "default": true
          },
          "outputRejectedRows": {
            "title": "Output rejected rows",
            "type": "boolean",
            "description": "Write rejected rows to the dataset with errors and original row data.",
            "default": true
          },
          "includeCleaningMetadata": {
            "title": "Include cleaning metadata",
            "type": "boolean",
            "description": "Add __changes and __warnings to cleaned rows.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}