{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Dataset Cleaner & Schema Normalizer",
    "description": "Clean, normalize, deduplicate and validate Apify datasets or JSON. Infer schemas, fix inconsistent fields, flatten nested data and prepare reliable datasets for AI agents, RAG, CRM, analytics, APIs and databases.",
    "version": "0.0",
    "x-build-id": "DniBqnlmevtSrdqvk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/komelf~ai-dataset-cleaner-schema-normalizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-komelf-ai-dataset-cleaner-schema-normalizer",
        "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/komelf~ai-dataset-cleaner-schema-normalizer/runs": {
      "post": {
        "operationId": "runs-sync-komelf-ai-dataset-cleaner-schema-normalizer",
        "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/komelf~ai-dataset-cleaner-schema-normalizer/run-sync": {
      "post": {
        "operationId": "run-sync-komelf-ai-dataset-cleaner-schema-normalizer",
        "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": {
          "source_mode": {
            "title": "Source mode",
            "enum": [
              "inline",
              "dataset"
            ],
            "type": "string",
            "description": "Inline is ready to try. Dataset mode reads an existing Apify dataset without modifying it.",
            "default": "inline"
          },
          "source_dataset_id": {
            "title": "Source dataset id",
            "type": "string",
            "description": "Used only in dataset mode. Select a dataset you can read; READ permission only."
          },
          "source_dataset": {
            "title": "Source dataset ID or name",
            "type": "string",
            "description": "Plain-text alternative for Published Tasks. Use the source dataset ID or name; ignored when the picker field is filled with the same value."
          },
          "inline_records": {
            "title": "Inline records",
            "type": "array",
            "description": "An array of JSON objects for tests and small workflows, up to 1,000 records."
          },
          "max_records": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum source rows to examine, including duplicates and rejected rows. Hard ceiling 100,000.",
            "default": 1000
          },
          "preset": {
            "title": "Preset",
            "enum": [
              "smart_clean",
              "minimal",
              "strict_normalization",
              "custom"
            ],
            "type": "string",
            "description": "Named presets control all advanced cleaning options. Choose Custom to edit advanced options.",
            "default": "smart_clean"
          },
          "trim_strings": {
            "title": "Trim strings",
            "type": "boolean",
            "description": "Trim surrounding whitespace recursively, including strings inside arrays.",
            "default": true
          },
          "normalize_nulls": {
            "title": "Normalize nulls",
            "type": "boolean",
            "description": "Convert configured placeholder strings to null; zero and false remain values.",
            "default": true
          },
          "null_placeholders": {
            "title": "Null placeholders",
            "type": "array",
            "description": "Case-insensitive exact matches after optional trimming. Does not infer missing keys.",
            "default": [
              "",
              "n/a",
              "na",
              "null",
              "none",
              "-",
              "unknown"
            ]
          },
          "remove_null_fields": {
            "title": "Remove null fields",
            "type": "boolean",
            "description": "Remove explicit null object fields recursively. Null array elements remain in place.",
            "default": false
          },
          "field_name_style": {
            "title": "Field name style",
            "enum": [
              "preserve",
              "snake_case",
              "camelCase"
            ],
            "type": "string",
            "description": "Normalize keys recursively. Collisions receive deterministic suffixes without overwriting values.",
            "default": "snake_case"
          },
          "rename_map": {
            "title": "Rename map",
            "type": "object",
            "description": "Exact original key to new key mapping, applied recursively before field naming.",
            "default": {}
          },
          "include_fields": {
            "title": "Include fields",
            "type": "array",
            "description": "Keep only these final top-level names after flattening. Empty list keeps every field.",
            "default": []
          },
          "exclude_fields": {
            "title": "Exclude fields",
            "type": "array",
            "description": "Remove these final top-level names; exclusion takes priority over inclusion.",
            "default": []
          },
          "flatten": {
            "title": "Flatten",
            "type": "boolean",
            "description": "Flatten nested nonempty objects. Arrays remain arrays and empty objects are preserved.",
            "default": true
          },
          "flatten_separator": {
            "title": "Flatten separator",
            "type": "string",
            "description": "Join nested field names with 1–4 characters. Collision suffixes use underscore.",
            "default": "_"
          },
          "flatten_depth": {
            "title": "Flatten depth",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Maximum object edges flattened (1–8). Deeper objects remain nested.",
            "default": 8
          },
          "infer_types": {
            "title": "Infer types",
            "type": "boolean",
            "description": "Conservative integers, decimals, booleans and ISO date recognition. Preserve leading zeros, large IDs and ambiguous dates.",
            "default": true
          },
          "normalize_email": {
            "title": "Normalize email",
            "type": "boolean",
            "description": "Preserve local-part case and lowercase domain. Invalid values remain present.",
            "default": true
          },
          "lowercase_email_local": {
            "title": "Lowercase email local",
            "type": "boolean",
            "description": "Also lowercase email local parts; opt in only when appropriate for your data.",
            "default": false
          },
          "normalize_url": {
            "title": "Normalize url",
            "type": "boolean",
            "description": "Normalize HTTP(S) scheme, host and default port; preserve query/fragment and never fetch URLs.",
            "default": true
          },
          "normalize_phone": {
            "title": "Normalize phone",
            "type": "boolean",
            "description": "Remove separators only from phone-like fields with 7–15 digits; never infer a country.",
            "default": true
          },
          "dedupe_mode": {
            "title": "Dedupe mode",
            "enum": [
              "none",
              "exact",
              "normalized",
              "key",
              "fuzzy"
            ],
            "type": "string",
            "description": "First occurrence wins. Normalized comparisons casefold strings without changing output. Fuzzy is opt in and bounded.",
            "default": "normalized"
          },
          "dedupe_keys": {
            "title": "Dedupe keys",
            "type": "array",
            "description": "Composite final top-level field names. Missing, null or empty key components keep the record distinct.",
            "default": []
          },
          "fuzzy_field": {
            "title": "Fuzzy field",
            "type": "string",
            "description": "One final top-level string field, required for fuzzy mode. Values over 256 characters are skipped.",
            "default": ""
          },
          "fuzzy_threshold": {
            "title": "Fuzzy threshold",
            "minimum": 0.000001,
            "maximum": 1,
            "type": "number",
            "description": "Similarity from >0 to 1, within two-character prefix blocks. Can cause false matches.",
            "default": 0.92
          },
          "fuzzy_max_candidates": {
            "title": "Fuzzy max candidates",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum 10,000 candidates. Oversized known datasets skip fuzzy matching; exact dedupe continues.",
            "default": 10000
          },
          "infer_schema": {
            "title": "Infer schema",
            "type": "boolean",
            "description": "Infer JSON Schema over all retained cleaned rows before dedupe. Metadata is excluded.",
            "default": true
          },
          "required_threshold": {
            "title": "Required threshold",
            "minimum": 0.000001,
            "maximum": 1,
            "type": "number",
            "description": "Presence fraction needed to mark fields required, using the full observed population.",
            "default": 0.95
          },
          "provided_schema": {
            "title": "Provided schema",
            "type": "object",
            "description": "Optional draft 2020-12 schema. References, regex and combinators are rejected for bounded offline validation. Formats are annotations.",
            "default": {}
          },
          "schema_invalid_behavior": {
            "title": "Schema invalid behavior",
            "enum": [
              "retain",
              "reject"
            ],
            "type": "string",
            "description": "Retain and report minimizes data loss. Reject removes invalid rows from output and billing.",
            "default": "retain"
          },
          "include_cleaning_metadata": {
            "title": "Include cleaning metadata",
            "type": "boolean",
            "description": "Append source index and consistency score. Collision suffixes preserve user fields.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}